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

QApplication::exit(0) not being called properly?

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 4.5.1
    • Widgets: Main Window
    • None
    • WindowsXP and Solaris 5.8

    Description

      We have a simple application which creates 2 QDialogs. One has the MainForm as the parent and one I parent to the application's desktop screen(1). My fileExit() code calls QApplication::exit(0) and both QDialogs will close properly. However, when I use the 'x' in the upper-right-corner, which calls MainForm::closeEvent, QApplication::exit(0) is never called and the application appears to hang (the MainForm and QDialog parented to the MainForm close, but the dialog parented to the desktop's screen(1) remains open).

      Is QApplication::exit(0) supposed to be called? Is there a bug, or am I mistaken? It seems like on a QMainWindow::closeEvent, that when the QApplication is destroyed, the related QDesktopWidget and its associated screens (QWidgets) should also be destroyed, which should in turn destroy the QDialog, however, this is not the case.

      Should I need to call QApplication::exit(0); explicitly in my MainForm::closeEvent()?

      I can provide example code if that is useful.

      Attachments

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

        Activity

          People

            monsen Marius Bugge Monsen
            mathew.pirz@itt.com Mathew Pirz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes