path: root/examples/widgets/mainwindows/menus/mainwindow.h
diff options
authorTor Arne Vestbø <>2021-10-12 15:25:26 +0200
committerTor Arne Vestbø <>2021-10-16 14:33:28 +0200
commit1dfc74970c8ab0bfc210b7038aad401189eae542 (patch)
treea85b88588e11a181ae97ee2e3aedef4bd452f8c7 /examples/widgets/mainwindows/menus/mainwindow.h
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 <> Reviewed-by: Volker Hilsheimer <>
Diffstat (limited to 'examples/widgets/mainwindows/menus/mainwindow.h')
0 files changed, 0 insertions, 0 deletions