summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-10-12 15:25:26 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-10-16 14:33:28 +0200
commit1dfc74970c8ab0bfc210b7038aad401189eae542 (patch)
treea85b88588e11a181ae97ee2e3aedef4bd452f8c7 /src/corelib/global
parent30404b49d8cc9ad8c4d9f128952844c20da0ad0d (diff)
Deduplicate lastWindowClosed handling
Whenever a window was closed, we had logic to check if it was the last window, and if so emitted lastWindowClosed and then tried to quit the application. But the automatic quit process also checked if there were any remaining windows, as this process could be triggered as a result of a QEventLoopLocker going out of scope. The two paths now share the same logic for determining if there are any remaining windows. The docs have been updated to reflect the original intent of the logic, dealing only with primary windows (top levels without a transient parent). This was how both the original code paths implemented their logic. For historical reasons the Qt::WA_QuitOnClose attribute is closely tied to the lastWindowClosed signal, and isn't merely limited to controlling whether we try an automatic quit when the last window closes. For now this behavior has been kept, but the docs have been updated to clarify how the attribute is handled in practice. Change-Id: If3d06b065236aad2e59e9091cac3146bc4cf79f6 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qnamespace.qdoc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 873a4c91ee..59a479d3d4 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -1126,10 +1126,10 @@
e.g., when a hidden widget was resized. This flag is set or cleared by the
Qt kernel.
- \value WA_QuitOnClose Makes Qt quit the application when the last widget
- with the attribute set has accepted closeEvent(). This behavior can be
- modified with the QGuiApplication::quitOnLastWindowClosed property. By default
- this attribute is set for all widgets of type Qt::Window.
+ \value WA_QuitOnClose Indicates that the widget should be taken into account
+ when deciding whether to quit the application when the last window is closed.
+ This behavior can be modified with the QGuiApplication::quitOnLastWindowClosed
+ property. By default this attribute is set for all widgets of type Qt::Window.
\value WA_Resized Indicates that the widget has an explicit size. This flag
is set or cleared by QWidget::resize() and QWidget::setGeometry().