summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-01-15 16:38:01 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-01-16 07:16:43 +0000
commitb782004149610d5c6af27e12d788acfb213b84d0 (patch)
treea78327eca7a990d6426095da827636c1b0fe68a6
parent8961493b4036af018842820238c4eda0c0717e64 (diff)
Fix multiple emission of QGuiApplication::lastWindowClosed() when native child widgets are used
Run the handling in QWindowPrivate::maybeQuitOnLastWindowClosed() for top level windows only. Fixes: QTBUG-73061 Change-Id: I74deb50b06a64e8ef0e438d2abf14888f778a46e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
-rw-r--r--src/gui/kernel/qwindow.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 61ef029cbd..e0da4d0ea7 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -2588,6 +2588,8 @@ void QWindowPrivate::maybeQuitOnLastWindowClosed()
return;
Q_Q(QWindow);
+ if (!q->isTopLevel())
+ return;
// Attempt to close the application only if this has WA_QuitOnClose set and a non-visible parent
bool quitOnClose = QGuiApplication::quitOnLastWindowClosed() && !q->parent();
QWindowList list = QGuiApplication::topLevelWindows();