Go to file
Tor Arne Vestbø 449b45ff34 Emit aboutToQuit from QCoreApplication::exit() instead of execCleanup()
The aboutToQuit signal is documented to be emitted "when the application
is about to quit the main event loop", which is useful "if your application
has to do some last-second cleanup", and is recommended over "putting it in
your application's main() function because on some platforms the exec() call
may not return".

However, if we're on a platform where the exec call may not return, it
will be because the event dispatcher's exec doesn't return, which means
we'll never get out of the call to eventLoop.exec(QEventLoop::ApplicationExec)
and into the execCleanup() code.

In addition, on macOS, where we do currently return to main(), we do so
by telling the platform to cancel the application termination, by returning
NSTerminateCancel from applicationShouldTerminate, after running the quit
logic of Qt via QWindowSystemInterface::handleApplicationTermination().
In the case of quitting applications due to system logout/shutdown, this
cancellation brings up a dialog saying the Qt application interrupted the
process, which luckily disappears again as soon as the application
actually terminates via main(). Moving the emit of aboutToQuit() earlier
in the flow, before we've cancelled the application termination, reduces
the chance that long running code triggered from this signal will keep the
dialog visible to the user.

Task-number: QTBUG-102321
Change-Id: I362737e9563069fc02b1e9639e1251d655d13949
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-10-23 21:17:09 +02:00
.github/workflows Repair github action workflow 2021-11-10 18:57:33 +01:00
bin Minor fixes for qt-configure-module 2022-06-27 17:55:19 +02:00
cmake Apple: Use 'en' instead of 'English' as development region 2022-10-23 17:36:46 +02:00
coin wasm: Add WebAssembly to platform of built tests on module-only build 2022-10-15 19:50:41 +02:00
config.tests Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
dist Add Qt 6.0.0 changes file 2020-11-16 10:02:08 +02:00
doc qdoc: improve \youtube documentation for DocBook images 2022-10-05 18:14:09 +00:00
examples Port from qAsConst() to std::as_const() 2022-10-11 23:17:18 +02:00
lib Purge all fonts 2015-08-18 19:59:14 +00:00
libexec Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
LICENSES Add license text file for Creative Commons Zero (CC0) 1.0 2022-10-19 12:06:09 +02:00
mkspecs Apple: Use 'en' instead of 'English' as development region 2022-10-23 17:36:46 +02:00
qmake Ensure proper format of Info.plist 2022-10-19 12:06:09 +02:00
src Emit aboutToQuit from QCoreApplication::exit() instead of execCleanup() 2022-10-23 21:17:09 +02:00
tests Apple: Use 'en' instead of 'English' as development region 2022-10-23 17:36:46 +02:00
util Port from qAsConst() to std::as_const() 2022-10-11 23:17:18 +02:00
.cmake.conf Replace the syncqt.pl script with syncqt tool 2022-09-27 13:12:11 +02:00
.gitattributes Give batch files CRLF line endings 2020-11-04 15:02:29 +00:00
.gitignore Assume qhelpgenerator in libexec instead of bin 2021-11-08 19:27:32 +01:00
.lgtm.yml Skip LGTM analysis for the bootstrap library and tools 2020-07-16 01:04:34 +02:00
.tag Update the git-archive export options 2012-09-07 15:39:31 +02:00
CMakeLists.txt Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
conanfile.py Conan: Do not force 'qt_host_path' usage in cross-build context 2022-06-22 18:18:42 +03:00
config_help.txt Add -disable-deprecated-up-to parameter to configure script 2022-08-19 23:52:05 +02:00
configure Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
configure.bat Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
configure.cmake wasm: add wasm_simd configure feature 2022-10-19 15:02:36 +00:00
dependencies.yaml Re-add dependencies.yaml now that qt5.git wip/qt6 builds fine 2019-09-18 13:19:31 +02:00
qt_cmdline.cmake QCryptographicHash: implement OpenSSL 3.0 support 2022-09-26 17:26:37 +02:00
sync.profile Move qurltlds_p.h out of src/network, and make it a .cpp file 2022-10-01 06:24:51 +00:00