mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-11 20:32:35 -03:00
qt: Override BitcoinApplication::event() to handle QEvent::Quit
This commit is contained in:
parent
b6b7815ddc
commit
e7fc50681e
2 changed files with 13 additions and 0 deletions
|
@ -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);
|
||||
|
|
|
@ -92,6 +92,9 @@ Q_SIGNALS:
|
|||
void splashFinished();
|
||||
void windowShown(BitcoinGUI* window);
|
||||
|
||||
protected:
|
||||
bool event(QEvent* e) override;
|
||||
|
||||
private:
|
||||
std::optional<InitExecutor> m_executor;
|
||||
OptionsModel *optionsModel;
|
||||
|
|
Loading…
Reference in a new issue