Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-37804

Window can be activated while modal dialog running on Mac (regression)

    XMLWordPrintable

Details

    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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vestbo Tor Arne Vestbø
            aclight Adam Light
            Votes:
            3 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes