summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2013-08-20 09:12:40 +0200
committerShawn Rutledge <shawn.rutledge@digia.com>2014-12-23 14:12:25 +0100
commit32422885fcd10af567b25bdca521fe9e3e68f36f (patch)
tree732eb0c9768b72be0bd64b9646dabfdc16fd637e /src/gui/kernel
parent7aadf03fead587299e129cf77fc8322a24cc0591 (diff)
emit lastWindowClosed even if quitOnLastWindowClosed is false
Behavior will agree with the docs. [ChangeLog][QtGui][QWindow] lastWindowClosed will be emitted even if quitOnLastWindowClosed is not set Task-number: QTBUG-32956 Change-Id: I7bb269d53894859fee27e171eea7ad472ea86af0 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qwindow.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index b9dba10f22..dd4bb57690 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -2290,24 +2290,22 @@ void QWindowPrivate::maybeQuitOnLastWindowClosed()
Q_Q(QWindow);
// Attempt to close the application only if this has WA_QuitOnClose set and a non-visible parent
bool quitOnClose = QGuiApplication::quitOnLastWindowClosed() && !q->parent();
-
- if (quitOnClose) {
- QWindowList list = QGuiApplication::topLevelWindows();
- bool lastWindowClosed = true;
- for (int i = 0; i < list.size(); ++i) {
- QWindow *w = list.at(i);
- if (!w->isVisible() || w->transientParent())
- continue;
- lastWindowClosed = false;
- break;
- }
- if (lastWindowClosed) {
- QGuiApplicationPrivate::emitLastWindowClosed();
+ QWindowList list = QGuiApplication::topLevelWindows();
+ bool lastWindowClosed = true;
+ for (int i = 0; i < list.size(); ++i) {
+ QWindow *w = list.at(i);
+ if (!w->isVisible() || w->transientParent())
+ continue;
+ lastWindowClosed = false;
+ break;
+ }
+ if (lastWindowClosed) {
+ QGuiApplicationPrivate::emitLastWindowClosed();
+ if (quitOnClose) {
QCoreApplicationPrivate *applicationPrivate = static_cast<QCoreApplicationPrivate*>(QObjectPrivate::get(QCoreApplication::instance()));
applicationPrivate->maybeQuit();
}
}
-
}
QWindow *QWindowPrivate::topLevelWindow() const