qt6-bb10/tests/auto/gui/kernel
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
..
noqteventloop Change license for tests files 2024-02-04 09:56:42 +01:00
qaction Change license for tests files 2024-02-04 09:56:42 +01:00
qactiongroup Change license for tests files 2024-02-04 09:56:42 +01:00
qaddpostroutine Change license for tests files 2024-02-04 09:56:42 +01:00
qbackingstore macOS: Implement support for backing store static contents 2024-02-13 13:55:01 +01:00
qclipboard Change license for tests files 2024-02-04 09:56:42 +01:00
qcursor Change license for tests files 2024-02-04 09:56:42 +01:00
qdrag Change license for tests files 2024-02-04 09:56:42 +01:00
qevent Change license for tests files 2024-02-04 09:56:42 +01:00
qfileopenevent Tests: make some QFile::open calls fail 2024-04-13 01:36:06 +02:00
qguiapplication Don't quit automatically via QEventLoopLocker if there are open windows 2024-04-29 14:26:38 +00:00
qguichronotimer Add QChronoTimer, a timer with nanoseconds precision 2024-03-03 19:56:55 +02:00
qguieventdispatcher QEventDispatcher: test with glib disabled too 2023-08-11 16:45:40 +03:00
qguieventloop CMake: Make gui tests standalone projects 2023-07-05 15:09:32 +02:00
qguimetatype Change license for tests files 2024-02-04 09:56:42 +01:00
qguitimer tst_QTimer: refactor CMake code 2023-11-22 06:34:29 +02:00
qguivariant Change license for tests files 2024-02-04 09:56:42 +01:00
qhighdpi Change license for tests files 2024-02-04 09:56:42 +01:00
qinputdevice Change license for tests files 2024-02-04 09:56:42 +01:00
qinputmethod Change license for tests files 2024-02-04 09:56:42 +01:00
qkeyevent Change license for tests files 2024-02-04 09:56:42 +01:00
qkeysequence Change license for tests files 2024-02-04 09:56:42 +01:00
qmouseevent Change license for tests files 2024-02-04 09:56:42 +01:00
qmouseevent_modal Change license for tests files 2024-02-04 09:56:42 +01:00
qopenglwindow Change license for tests files 2024-02-04 09:56:42 +01:00
qpalette Change license for tests files 2024-02-04 09:56:42 +01:00
qpixelformat Change license for tests files 2024-02-04 09:56:42 +01:00
qrasterwindow Remove extra semi-colons 2024-02-06 20:17:18 +09:00
qscreen Change license for tests files 2024-02-04 09:56:42 +01:00
qshortcut Change license for tests files 2024-02-04 09:56:42 +01:00
qsurfaceformat Change license for tests files 2024-02-04 09:56:42 +01:00
qtouchevent Change license for tests files 2024-02-04 09:56:42 +01:00
qwindow QWindow: Persist foreign winId to support destroy/create cycles 2024-04-19 14:54:17 +02:00
CMakeLists.txt Add QChronoTimer, a timer with nanoseconds precision 2024-03-03 19:56:55 +02:00