2017-10-06 117 views
1

深色邊框我創建了一個對話框,陰影效果無框窗口顯示在Linux上

Qt::WindowFlags flags = Qt::Dialog| Qt::FramelessWindowHint; 

QGraphicsDropShadowEffect* effect = new QGraphicsDropShadowEffect; 
effect->setOffset(4); 
effect->setBlurRadius(9); 
contWdget->setGraphicsEffect(effect); 

這完美的作品在Windows,但是當我在Linux中打開同一個對話框顯示它的深黑色邊框對話框周圍。

我需要做些什麼才能使其在Linux上工作。

enter image description here enter image description here

+0

你能共享問題(的Windows VS Linux)的快照? – jgorosdev

回答

0

像這樣在linux下使用Qt::FramelessWindowHint無框窗:

QDialog *dialog = new QDialog(); 
dialog->setWindowFlags(Qt::FramelessWindowHint); 
dialog->show(); 

screenshot

測試上:

Qt Creator 4.3.1

Based on Qt 5.9.0 (GCC 5.3.1 20160406 (Red Hat 5.3.1-6), 64 bit)

Ubuntu 16.04 LTS