我正在创建一个对话框,需要无框架的窗口,我使用
setWindowFlags(Qt::FramelessWindowHint );这在windows上有效,但在linux上不起作用。
BaseClass
csGuiDialog::csGuiDialog(QWidget *parent)
: QDialog(parent)
{
Qt::WindowFlags flags = Qt::Dialog| Qt::FramelessWindowHint;
QWidget::setWindowFlags(flags);
setFocusPolicy(Qt::StrongFocus);
}派生类
csGuiOutputSelectionMainWindow::csGuiOutputSelectionMainWindow(QWidget *parent)
: csGuiDialog(parent)
{
setTitle(QString("Selection Window"));
setWindowFlags(Qt::FramelessWindowHint );
this->setStyleSheet("background-color: rgb(255, 255, 255)");
}为什么它不能在Linux上工作
发布于 2017-10-26 15:25:24
QRectF framelessGeom = QRectF(15,10,900,575);
setMask(framelessGeom.toRect());这起作用了,但小部件右侧和底部的阴影效果消失了。此阴影效果是linux中所有小部件的默认效果
https://stackoverflow.com/questions/46947179
复制相似问题