Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.5.1, 5.9.2, 5.12, 5.14.1
-
Mac OSX 10.9.2
macOS 10.12.6
Description
On Macintosh using Qt 5, if a modal dialog is running it is possible to click on the title bar of a modeless dialog and activate the other window.
This should not be allowed. This is a regression from Qt 4.8.5 and 4.8.6, in which it is not possible to activate another window while a modal dialog is running.
Use the attached files to reproduce.
1. Build and run the application
2. Select the modal dialog (window title is "Modal dialog") and move it over some so that it's not entirely covering the modeless dialog below.
3. Click on the title bar of the modeless dialog (window title is "Modeless dialog"). It is activated and can be moved around and resized (though not killed). It should not be possible to interact with the modeless dialog window at all.
Here are the full contents of the main.cpp file in the attached archive needed to reproduce this problem. It's very simple to reproduce.
#include <QApplication> #include <QWidget> #include <QDialog> int main(int argc, char *argv[]) { QApplication a(argc, argv); QDialog modelessD; modelessD.setWindowTitle("Modeless dialog"); modelessD.setModal(false); modelessD.show(); QDialog modalD; modalD.setModal(true); modalD.setWindowTitle("Modal dialog"); modalD.exec(); return a.exec(); }
The behavior on Windows using both 4.8 and 5.3-alpha1 is correct.