diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2022-02-12 15:37:43 +0200 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2022-02-12 16:04:57 +0200 |
commit | e7fc50681e99e3c726db2bc4d3d425ed8a0fc6b3 (patch) | |
tree | 74772a02da43bf294fa5e0e3e4105fef0fce897f /src/qt/bitcoin.cpp | |
parent | b6b7815ddcff53177bb1f6318b39a4134cf42cb1 (diff) |
qt: Override BitcoinApplication::event() to handle QEvent::Quit
Diffstat (limited to 'src/qt/bitcoin.cpp')
-rw-r--r-- | src/qt/bitcoin.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 6a2781079c..497805f2bb 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -450,6 +450,16 @@ WId BitcoinApplication::getMainWinId() const return window->winId(); } +bool BitcoinApplication::event(QEvent* e) +{ + if (e->type() == QEvent::Quit) { + requestShutdown(); + return true; + } + + return QApplication::event(e); +} + static void SetupUIArgs(ArgsManager& argsman) { argsman.AddArg("-choosedatadir", strprintf("Choose data directory on startup (default: %u)", DEFAULT_CHOOSE_DATADIR), ArgsManager::ALLOW_ANY, OptionsCategory::GUI); |