Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
4.7.3
-
None
Description
When the last widget is closed and quitOnLastWindowClosed is not set to false, QWidget posts a QEvent::Quit to QApplication. If another widget is made visible before the next call to processEvents(), QWidget, automatically removes this event.
However this is not being done when native widgets (e.g. file dialogs are used). This can lead to some strange behavior (event loops in the thread quit immediately, etc.). I would suggest to add a similar call to remove such posted quit events before opening non-Qt windows from inside Qt. IMO it shouldn't make a difference whether Qt ends up using a native widget or not.
This of course does not occur when quitOnLastWindowClosed is set to false. Therefore if my suggestion is not implemented, I would like to suggest to add documentation to the appropriate classes, informing developers of this behavior and of the proper solution (setting quitOnLastWindowClosed to false in QApplication).
This was originally reported by LinusA at http://developer.qt.nokia.com/forums/viewthread/7063/