qt6-bb10/tests/auto/gui
Tor Arne Vestbø 0b494c47d3 Don't quit automatically via QEventLoopLocker if there are open windows
As part of df359bcb70 the semantics and
interaction between QEventLoopLocker and QGuiApplication was changed,
based on the assumption that these two mechanisms were independent
and should not affect each other.

This had a surprising regression where the use of QEventLoopLocker in
combination with the QCoreApplication::isQuitLockEnabled() automatic
quit would end up quitting the app, even if it had open windows, for
example when the last job of some internal job queue finished.

It could be argued that if the app has open windows that should not
be closed, they should ignore the Close event, and that an application
with running QEventLoopLocker jobs should maintain an active window
showing the progress of those jobs, but still, this is regression
that we want to fix.

We now bail out if !lastWindowClosed() in QGuiApplication's
canQuitAutomatically, which is triggered from QEventLoopLocker's
isQuitLockEnabled() behavior. And we do so regardless of whether
quitOnLastWindowClosed is set or not, as the latter property
determines the behavior when closing a window, not the behavior
when a QEventLoopLocker goes out of scope.

Similarly, we now block quitting of the application when triggered
by quitOnLastWindowClosed() if a QEventLoop is active, regardless of
the isQuitLockEnabled(), as the latter property is determining
whether we should trigger a quit, not whether we should block them.

[ChangeLog][Important behavior changes] Fixed a regression where
the last QEventLoopLocker going out of scope would quit the app,
even if there were open windows, if quitOnLastWindowClosed was
false.

[ChangeLog][Important behavior changes] Fixed a regression where
closing the last window would quit the app, even if there were
active QEventLoopLockers, if isQuitLockEnabled was false.

Fixes: QTBUG-124386
Pick-to: 6.7 6.5
Change-Id: I84fd0ddea78a2f417f3a17b326113c880079cf85
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-04-29 14:26:38 +00:00
..
image QMovie: fix regression in frame delays 2024-04-24 15:13:12 +00:00
itemmodels QFileSystemModel: Add role for fileinfo 2024-04-11 23:12:42 +01:00
kernel Don't quit automatically via QEventLoopLocker if there are open windows 2024-04-29 14:26:38 +00:00
math3d Change license for tests files 2024-02-04 09:56:42 +01:00
painting print: Clamp margins entered by the user in the page setup dialog 2024-04-25 14:22:30 +03:00
platform Change license for tests files 2024-02-04 09:56:42 +01:00
qopengl Change license for tests files 2024-02-04 09:56:42 +01:00
qopenglconfig Change license for tests files 2024-02-04 09:56:42 +01:00
qvulkan Revert "Android: SKIP cases failing on Android 12 CI with 16GB RAM" 2024-04-05 20:31:07 +00:00
rhi Revert "Skip Vulkan on Android in QRhi autotest" 2024-04-05 20:31:07 +00:00
text Introduce optional smarter font merging with ContextFontMerging 2024-04-26 12:30:53 +02:00
util Improve KTX file reading memory safety 2024-02-09 13:08:44 +01:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00