summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@nokia.com>2010-01-22 13:01:54 (GMT)
committerTor Arne Vestbø <tor.arne.vestbo@nokia.com>2010-02-05 14:44:31 (GMT)
commitf75d55f1a71cae9864ca4bf12c92fcd9e34ed651 (patch)
treed0e6199a1458106c9737829157b5991b5d467226 /src/gui/kernel
parenta767da6f2d0fbee707f5c2fe896fa501b3da6b07 (diff)
downloadQt-f75d55f1a71cae9864ca4bf12c92fcd9e34ed651.zip
Qt-f75d55f1a71cae9864ca4bf12c92fcd9e34ed651.tar.gz
Qt-f75d55f1a71cae9864ca4bf12c92fcd9e34ed651.tar.bz2
Revert "Prevent widgets with WA_DontShowOnScreen from keeping the app running"
This reverts commit 424eabac69df3234006669a69ca0ec9653e4ce63. The commit changed behavior of WA_QuitOnClose when WA_DontShowOnScreen was used, but WA_DontShowOnScreen should only have visual effects. Reviewed-by: Bjørn Erik Nilsen <bjorn.nilsen@nokia.com>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qwidget.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index e678220..884447d 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -7573,23 +7573,21 @@ bool QWidgetPrivate::close_helper(CloseMode mode)
if (isMain)
QApplication::quit();
#endif
- // Attempt to close the application only if this widget has the
- // WA_QuitOnClose flag set set and has a non-visible parent
- quitOnClose = quitOnClose && (parentWidget.isNull() || !parentWidget->isVisible() || parentWidget->testAttribute(Qt::WA_DontShowOnScreen));
+ // Attempt to close the application only if this has WA_QuitOnClose set and a non-visible parent
+ quitOnClose = quitOnClose && (parentWidget.isNull() || !parentWidget->isVisible());
if (quitOnClose) {
- // If there is no non-withdrawn primary window left (except
- // the ones without QuitOnClose or with WA_DontShowOnScreen),
- // we emit the lastWindowClosed signal
+ /* if there is no non-withdrawn primary window left (except
+ the ones without QuitOnClose), we emit the lastWindowClosed
+ signal */
QWidgetList list = QApplication::topLevelWidgets();
bool lastWindowClosed = true;
for (int i = 0; i < list.size(); ++i) {
QWidget *w = list.at(i);
- if ((w->isVisible() && !w->testAttribute(Qt::WA_DontShowOnScreen))
- && !w->parentWidget() && w->testAttribute(Qt::WA_QuitOnClose)) {
- lastWindowClosed = false;
- break;
- }
+ if (!w->isVisible() || w->parentWidget() || !w->testAttribute(Qt::WA_QuitOnClose))
+ continue;
+ lastWindowClosed = false;
+ break;
}
if (lastWindowClosed)
QApplicationPrivate::emitLastWindowClosed();