aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2022-05-23 08:56:11 +0200
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2022-05-23 08:57:41 +0200
commitdfe11a1a7eac5254cbb027402bca3126f1fb3712 (patch)
treeac9b7d4ee228a9f38ad16c42549519024e9ecc16 /src/qt
parent6d20f4b920909e56946b3c15c9a7ec8602159886 (diff)
parent252f363f2feff243cae47731d59dfa1b74dd4386 (diff)
Merge bitcoin-core/gui#586: Getting ready to Qt 6 (6/n). Replace `QCoreApplication::quit()` with `QCoreApplication::exit(0)`
252f363f2feff243cae47731d59dfa1b74dd4386 qt: Replace `QCoreApplication::quit()` with `QCoreApplication::exit(0)` (Hennadii Stepanov) Pull request description: ### Qt 5: - no behavior change. See https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/kernel/qcoreapplication.cpp?h=5.15#n2012: ```cpp void QCoreApplication::quit() { exit(0); } ``` ### Qt 6: - this change avoids sending a duplicated `QEvent::Quit` We use `QEvent::Quit` to [handle](https://github.com/bitcoin-core/gui/pull/547) macOS dock menu events. Qt 6 uses `QEvent::Quit` more [widely](https://github.com/qt/qtbase/commit/89f7a2759c6b51343d0a1ca5a82d575abba04e0c). We do not want a duplicated `QEvent::Quit` which fires `Assert(node.args);` in the [`Shutdown()`](https://github.com/bitcoin-core/gui/blob/d1b3dfb275fd98e37cfe8a0f7cea7d03595af2e8/src/init.cpp#L200) function. ACKs for top commit: promag: Code review ACK 252f363f2feff243cae47731d59dfa1b74dd4386. Tree-SHA512: 6a04cbcf523c0375158a59b29afadf18da99738c8db8b8728f99319a8cdc10806d2f06dc5a7d3b8b0e1a5f1711be778a75d4ecdefef7cf66e26ae2848f7f57db
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/bitcoin.cpp4
-rw-r--r--src/qt/test/apptests.cpp2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp
index 8cac28400f..fa45e3908a 100644
--- a/src/qt/bitcoin.cpp
+++ b/src/qt/bitcoin.cpp
@@ -308,7 +308,9 @@ void BitcoinApplication::startThread()
/* communication to and from thread */
connect(&m_executor.value(), &InitExecutor::initializeResult, this, &BitcoinApplication::initializeResult);
- connect(&m_executor.value(), &InitExecutor::shutdownResult, this, &QCoreApplication::quit);
+ connect(&m_executor.value(), &InitExecutor::shutdownResult, this, [] {
+ QCoreApplication::exit(0);
+ });
connect(&m_executor.value(), &InitExecutor::runawayException, this, &BitcoinApplication::handleRunawayException);
connect(this, &BitcoinApplication::requestedInitialize, &m_executor.value(), &InitExecutor::initialize);
connect(this, &BitcoinApplication::requestedShutdown, &m_executor.value(), &InitExecutor::shutdown);
diff --git a/src/qt/test/apptests.cpp b/src/qt/test/apptests.cpp
index b191082ab0..9648ef6188 100644
--- a/src/qt/test/apptests.cpp
+++ b/src/qt/test/apptests.cpp
@@ -119,6 +119,6 @@ AppTests::HandleCallback::~HandleCallback()
assert(it != callbacks.end());
callbacks.erase(it);
if (callbacks.empty()) {
- m_app_tests.m_app.quit();
+ m_app_tests.m_app.exit(0);
}
}