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

Qt hangs when a modal dialog is killed then the parent window calls an event-triggered processEvents() within the (now inactive) modal child's event loop

    XMLWordPrintable

Details

    Description

      Using Qt 5.4 and 5.5a on Mac OS X 10.10 Qt hangs in the following conditions:
      Class MyApplication inherits QApplication and overrides the QApplication::notify() function to call processEvents() when receiving the WindowActivate QEvent.
      MyApplication spawns a modal dialog.
      The modal dialog does exec().
      The modal dialog is killed, calling done().
      MyApplication becomes the top window and within the resulting notify() call calls processEvents();
      Qt hangs. The main window does not respond to any user input. It still receives events via notify (confirmed in debugging mode). If you pause execution in notify and look at the call stack you will see Qt is still in the modal dialog's event loop.
      The simple attached project illustrates this. Execute the project and click the only button in the main window, then click the button in the modal dialog that results. The modal dialog's button kills it (you can also just kill the modal dialog using the Mac window little red button). Qt is now effectively hung. The main window will not respond to user input and cannot be killed.

      Attachments

        Issue Links

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

          Activity

            People

              thiago Thiago Macieira
              Nate Hyde Nate Hyde
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes