The problem is that Designer set Qt::WindowModal on the message box which when the message box has a parent changes the window type to Qt::Sheet. Haven't checked qt4 but at least Qt::Dialog and Qt::Sheet are treated the same in the xcb so I think that's the right thing to do for the theme as well (Bespin seems to use different background color for them... which is also fine... if not a bug). Reproducible: Always Minimum cpp program to demostrate the problem class MainWindow: public QMainWindow { public: void closeEvent(QCloseEvent *event) { QMessageBox box(QMessageBox::Information, "", "", QMessageBox::Discard, this); // box.setWindowModality(Qt::WindowModal); // uncomment this line to see the problem box.exec(); } }; int main(int argc, char **argv) { QApplication app(argc, argv); MainWindow win; win.show(); return app.exec(); }
I'm confused: can't reproduce the issue here with the provided program. (whether or not I comment the modality line, appearing dialog is always transparent) Qt version is 4.8.5 What's yours ? In any case I am fine with checking on Qt::Sheet windows
Git commit 059583b8c61ca78b6d8912ee67ad90ed67773b1b by Hugo Pereira Da Costa. Committed on 25/11/2013 at 14:41. Pushed by hpereiradacosta into branch 'master'. Added Qt::Sheet to the list of windows to tag as transparent. M +1 -0 style/oxygenargbhelper.cpp http://commits.kde.org/oxygen-transparent/059583b8c61ca78b6d8912ee67ad90ed67773b1b
I'm using Qt 4.8.5 (-6 in arch linux package). I was on the master of oxygen-transparent (which is just two commit behind right now). Can you see this problem with designer-qt4 then? I believe you would probably need to do this at other places as well (drawPrimitive at least? probably). With this patch, the background of the message box is not drawn at all.
And also blur helper.
Git commit db5bac3c67321087e98579f3785ac79d4a2a2caf by Hugo Pereira Da Costa. Committed on 25/11/2013 at 14:59. Pushed by hpereiradacosta into branch 'master'. also ensured styled background is painted on Qt::sheet M +4 -2 style/oxygenstyle.cpp http://commits.kde.org/oxygen-transparent/db5bac3c67321087e98579f3785ac79d4a2a2caf
could reproduced with Qt designer blur helper does not need change (apparently already detect the window it seems) thanks for investigating this.
Well, not sure about the internal logic of oxygen-transparent but there wasn't any blur effect with the previous patch.. Anyway, everything looks fine here now.
P.S. the dialog that has the problem is the one that popup when you close the first window... Hopfully that's not what confuses you .... (The code was copied from designer and that's why it's in closeEvent)
Many thanks for the notification. Modal dialogs are supposed to invert the color (by default config) but i ruled out sheets[1] from everything because that concept only exists on OSX and there is very obviously the content blocker. So it makes sense to treat them equally and tagging window only modal dialogs as sheet is "correct", while -tbh- the concept sucks (otherwise I had faked it ;-) [1] https://developer.apple.com/library/mac/documentation/userexperience/conceptual/applehiguidelines/art/wn_sheetasmodaldlg_2x.png
Yeah, I have noticed Qt::Sheet should be Mac specific, and that's why I'm confused when I see this[1] in the platform independent code.... Do you think this should be considered as a bug of Qt? Given that in qt's document[2] it says Qt::Sheet "Indicates that the window is a Macintosh sheet." and its certainly not. [1] https://qt.gitorious.org/qt/qt/source/157da36977213237939df14608753bb3ec280f0b:src/gui/dialogs/qmessagebox.cpp#L2568 [2] http://qt-project.org/doc/qt-4.8/qt.html#WindowType-enum
(In reply to comment #10) > Do you think this should be considered as a bug of Qt? Rather not. Setting the attribute (on OSX) for WindowModal windows is reasonable (to not say: "demanded by Apple HIG") and actually you could not prevent setting this attribute anyway (unless you'd introduce strictly platform dependent attributes and had to test the platform and the attribute on every set or get operation) The fact that the state has in general no further meaning on other platforms (just like the Drawer, an even more stupid concept on OSX ;-) does not imply that setting it is a bug per se. (In fact I abuse the brushed metal attribute to select windows for the glass look =)