From 0cb39706cec694ee1762344d3abb3f37c320ec7b Mon Sep 17 00:00:00 2001 From: pasta Date: Fri, 13 Nov 2026 00:12:28 -0600 Subject: [PATCH 1/6] fix(qt): open the requested options page when the wallet is disabled The options tab buttons were numbered in the order they were added, so with -disablewallet the Wallet and CoinJoin buttons were skipped and Tab values no longer matched the button IDs. Clicking the proxy icon (TAB_NETWORK) opened Appearance instead of Network. Register every button under its Tab value and select the page widget that belongs to it, rather than using the ID as a stack index. The new test destroys an OptionsDialog that never had a model, so also initialize AppearanceWidget::model: its destructor read the pointer uninitialized in that case. Co-Authored-By: Claude Fable 5.2 --- src/qt/appearancewidget.h | 2 +- src/qt/optionsdialog.cpp | 19 +++++++++++-------- src/qt/test/optiontests.cpp | 15 +++++++++++++++ src/qt/test/optiontests.h | 1 + 4 files changed, 28 insertions(+), 9 deletions(-) diff --git a/src/qt/appearancewidget.h b/src/qt/appearancewidget.h index 2fa1f9b8b769..3a56932af28b 100644 --- a/src/qt/appearancewidget.h +++ b/src/qt/appearancewidget.h @@ -44,7 +44,7 @@ private Q_SLOTS: private: Ui::AppearanceWidget* ui; QDataWidgetMapper* mapper; - OptionsModel* model; + OptionsModel* model{nullptr}; bool fAcceptChanges{false}; QString prevTheme; int prevScale; diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 1d0b4f5eee10..23f9ffd799b6 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -110,7 +110,13 @@ OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet) #endif pageButtons = new QButtonGroup(this); - pageButtons->addButton(ui->btnMain, pageButtons->buttons().size()); + pageButtons->addButton(ui->btnMain, TAB_MAIN); + pageButtons->addButton(ui->btnWallet, TAB_WALLET); + pageButtons->addButton(ui->btnCoinJoin, TAB_COINJOIN); + pageButtons->addButton(ui->btnNetwork, TAB_NETWORK); + pageButtons->addButton(ui->btnDisplay, TAB_DISPLAY); + pageButtons->addButton(ui->btnAppearance, TAB_APPEARANCE); + /* Remove Wallet/CoinJoin tabs and 3rd party-URL textbox in case of -disablewallet */ if (!m_enable_wallet) { ui->stackedWidgetOptions->removeWidget(ui->pageWallet); @@ -124,16 +130,11 @@ OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet) ui->showGovernanceCycleIcon->hide(); } else { ui->btnCoinJoin->setText(QString::fromStdString(gCoinJoinName)); - pageButtons->addButton(ui->btnWallet, pageButtons->buttons().size()); - pageButtons->addButton(ui->btnCoinJoin, pageButtons->buttons().size()); } - pageButtons->addButton(ui->btnNetwork, pageButtons->buttons().size()); - pageButtons->addButton(ui->btnDisplay, pageButtons->buttons().size()); - pageButtons->addButton(ui->btnAppearance, pageButtons->buttons().size()); connect(pageButtons, &QButtonGroup::idClicked, this, &OptionsDialog::showPage); - showPage(0); + showPage(TAB_MAIN); #ifdef ENABLE_EXTERNAL_SIGNER ui->externalSignerPath->setToolTip(ui->externalSignerPath->toolTip().arg(PACKAGE_NAME)); @@ -416,7 +417,9 @@ void OptionsDialog::showPage(int index) GUIUtil::setFont(vecNormal, GUIUtil::FontWeight::Normal, 16); GUIUtil::updateFonts(); - ui->stackedWidgetOptions->setCurrentIndex(index); + QWidget* const pages[]{ui->pageMain, ui->pageWallet, ui->pageCoinJoin, + ui->pageNetwork, ui->pageDisplay, ui->pageAppearance}; + ui->stackedWidgetOptions->setCurrentWidget(pages[index]); btnActive->setChecked(true); } diff --git a/src/qt/test/optiontests.cpp b/src/qt/test/optiontests.cpp index 2d3ba5d027e5..38fb5bbefd05 100644 --- a/src/qt/test/optiontests.cpp +++ b/src/qt/test/optiontests.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -17,6 +18,7 @@ #include #include #include +#include #include #include @@ -325,3 +327,16 @@ void OptionTests::fontScaleSources() set_sources(none, none, none); GUIUtil::setFontScale(previous_scale); } + +void OptionTests::tabsWithoutWallet() +{ + OptionsDialog dialog{nullptr, /*enableWallet=*/false}; + auto* pages = dialog.findChild("stackedWidgetOptions"); + QVERIFY(pages); + dialog.setCurrentTab(OptionsDialog::TAB_NETWORK); + QCOMPARE(pages->currentWidget()->objectName(), QString{"pageNetwork"}); + dialog.setCurrentTab(OptionsDialog::TAB_DISPLAY); + QCOMPARE(pages->currentWidget()->objectName(), QString{"pageDisplay"}); + dialog.setCurrentTab(OptionsDialog::TAB_APPEARANCE); + QCOMPARE(pages->currentWidget()->objectName(), QString{"pageAppearance"}); +} diff --git a/src/qt/test/optiontests.h b/src/qt/test/optiontests.h index 6548972c092b..7d2eac838eac 100644 --- a/src/qt/test/optiontests.h +++ b/src/qt/test/optiontests.h @@ -25,6 +25,7 @@ private Q_SLOTS: void invalidLangSetting(); void parametersInteraction(); void extractFilter(); + void tabsWithoutWallet(); void effectivePointSize(); void updateFontsWithPixelSizedWidget(); void fontScaleSources(); From a37fe69c65591332b909e16b4c5208f42f43dbf2 Mon Sep 17 00:00:00 2001 From: pasta Date: Fri, 13 Nov 2026 00:12:28 -0600 Subject: [PATCH 2/6] fix(qt): stop a wallet migration when the user cancels it Cancelling the confirmation box returned without emitting finished(), so the activity was never deleted. Cancelling the passphrase prompt was ignored and the migration went ahead with an empty passphrase. A wallet unlocked only for mixing was not asked for its passphrase at all. Finish the activity on both cancel paths and prompt mixing-only wallets too. An unlock attempt that fails partway can leave the wallet unlocked, so a cancelled prompt puts the wallet back into the locked or mixing-only state it started in. Co-Authored-By: Claude Fable 5.2 --- src/qt/walletcontroller.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/qt/walletcontroller.cpp b/src/qt/walletcontroller.cpp index 8f1d0dded36c..03c721b66ce8 100644 --- a/src/qt/walletcontroller.cpp +++ b/src/qt/walletcontroller.cpp @@ -573,15 +573,27 @@ void MigrateWalletActivity::migrate(WalletModel* wallet_model) "an incorrect migration, the backup can be restored with the \"Restore Wallet\" functionality.")); box.setStandardButtons(QMessageBox::Yes|QMessageBox::Cancel); box.setDefaultButton(QMessageBox::Yes); - if (box.exec() != QMessageBox::Yes) return; + if (box.exec() != QMessageBox::Yes) { + Q_EMIT finished(); + return; + } // Get the passphrase if it is encrypted regardless of it is locked or unlocked. We need the passphrase itself. SecureString passphrase; WalletModel::EncryptionStatus enc_status = wallet_model->getEncryptionStatus(); - if (enc_status == WalletModel::EncryptionStatus::Locked || enc_status == WalletModel::EncryptionStatus::Unlocked) { + if (enc_status == WalletModel::EncryptionStatus::Locked || + enc_status == WalletModel::EncryptionStatus::Unlocked || + enc_status == WalletModel::EncryptionStatus::UnlockedForMixingOnly) { AskPassphraseDialog dlg(AskPassphraseDialog::Unlock, m_parent_widget, &passphrase); dlg.setModel(wallet_model); - dlg.exec(); + if (dlg.exec() != QDialog::Accepted) { + // A failed unlock attempt can leave the wallet unlocked. + if (enc_status != WalletModel::EncryptionStatus::Unlocked) { + wallet_model->setWalletLocked(true, {}, enc_status == WalletModel::EncryptionStatus::UnlockedForMixingOnly); + } + Q_EMIT finished(); + return; + } } // GUI needs to remove the wallet so that it can actually be unloaded by migration From 71325a1eefc582c619d20303036d01e7b552d103 Mon Sep 17 00:00:00 2001 From: pasta Date: Fri, 13 Nov 2026 00:12:28 -0600 Subject: [PATCH 3/6] fix(qt): require a fee address for shared masternode service changes The service update and revoke dialogs hide the Automatic fee source for a shared masternode, because Core's automatic choice is the first share's reward address, which usually belongs to another wallet. With no funded address in this wallet the picker was empty, yet OK stayed enabled and the request was sent without a fee source. Disable OK until a fee address is selected, re-validate when the selection changes, and explain the disabled button in its tooltip. m_is_shared moves from UpdateShareDialog to the base dialog so the other dialogs can use it. Co-Authored-By: Claude Fable 5.2 --- src/qt/masternodedialogs.cpp | 21 ++++++++++--- src/qt/masternodedialogs.h | 3 +- src/qt/sharedmndialogs.cpp | 1 - src/qt/sharedmndialogs.h | 1 - src/qt/test/masternodemaintenancetests.cpp | 34 ++++++++++++++++++++++ 5 files changed, 53 insertions(+), 7 deletions(-) diff --git a/src/qt/masternodedialogs.cpp b/src/qt/masternodedialogs.cpp index d2432d64a1e2..d7afd59bd65f 100644 --- a/src/qt/masternodedialogs.cpp +++ b/src/qt/masternodedialogs.cpp @@ -160,6 +160,7 @@ MasternodeActionDialog::MasternodeActionDialog(interfaces::Node& node, WalletMod m_wallet_model{wallet_model}, m_protx_hash{entry.proTxHashRaw()}, m_operator_pubkey{entry.operatorPubKeyBytes()}, + m_is_shared{entry.isShared()}, m_runner{wallet_model ? new MasternodeOperationRunner(node.evo(), wallet_model->wallet(), this) : nullptr} { } @@ -228,10 +229,11 @@ bool MasternodeActionDialog::canSign() const return m_wallet_model != nullptr && !m_wallet_model->wallet().privateKeysDisabled(); } -void MasternodeActionDialog::setOkValid(bool valid) +void MasternodeActionDialog::setOkValid(bool valid, const QString& tooltip) { m_valid = valid; if (m_ok_button) m_ok_button->setEnabled(valid && canSign() && !m_busy); + if (m_ok_button && canSign()) m_ok_button->setToolTip(tooltip); } void MasternodeActionDialog::showError(const QString& message) @@ -279,7 +281,7 @@ void MasternodeActionDialog::setBusy(bool busy) QApplication::restoreOverrideCursor(); } if (m_button_box) m_button_box->setEnabled(!busy); - setOkValid(m_valid); + if (m_ok_button) setOkValid(m_valid, m_ok_button->toolTip()); } void MasternodeActionDialog::resolveOperatorKey(OperatorSecretWidget& widget, SecretCallback callback) @@ -421,6 +423,8 @@ UpdateServiceDialog::UpdateServiceDialog(interfaces::Node& node, WalletModel* wa "payout. Select an address only to override that choice.")); } + connect(m_fee_source, qOverload(&QComboBox::currentIndexChanged), this, &UpdateServiceDialog::validate); + setupUi(m_type == MnType::Evo ? tr("Update EvoNode Service") : tr("Update Masternode Service"), tr("Update the registered service endpoints. A successful update also revives a PoSe-banned " "masternode. Every current value is prefilled so unchanged fields are preserved."), @@ -438,7 +442,9 @@ void UpdateServiceDialog::validate() if (m_type == MnType::Evo) { ok &= IsValidPlatformNodeId(m_platform_node_id_edit->text().trimmed()); } - setOkValid(ok); + const bool has_fee_source{!m_is_shared || !m_fee_source->selectedAddress().isEmpty()}; + setOkValid(ok && has_fee_source, + has_fee_source ? QString{} : tr("Select a wallet address with funds to pay the transaction fee.")); } std::optional UpdateServiceDialog::buildNetInfo(QString& error) const @@ -681,13 +687,20 @@ RevokeDialog::RevokeDialog(interfaces::Node& node, WalletModel* wallet_model, co "payout. Select an address only to override that choice.")); } + connect(m_fee_source, qOverload(&QComboBox::currentIndexChanged), this, &RevokeDialog::validate); + setupUi(tr("Revoke Masternode Service"), tr("Revoking clears the service address and PoSe-bans the masternode until its owner changes the " "operator key. The collateral is not affected."), form, tr("Revoke")); } -void RevokeDialog::validate() { setOkValid(m_operator_key->isValid()); } +void RevokeDialog::validate() +{ + const bool has_fee_source{!m_is_shared || !m_fee_source->selectedAddress().isEmpty()}; + setOkValid(m_operator_key->isValid() && has_fee_source, + has_fee_source ? QString{} : tr("Select a wallet address with funds to pay the transaction fee.")); +} std::optional RevokeDialog::buildRequest(CBLSSecretKey operator_key, QString& error) const { diff --git a/src/qt/masternodedialogs.h b/src/qt/masternodedialogs.h index 0375d5d9bbd5..a997cbb1e43b 100644 --- a/src/qt/masternodedialogs.h +++ b/src/qt/masternodedialogs.h @@ -95,7 +95,7 @@ public Q_SLOTS: FeeSourcePicker* addFeeSourceRow(QFormLayout* form, const QString& automatic_note); bool canSign() const; - void setOkValid(bool valid); + void setOkValid(bool valid, const QString& tooltip = {}); void showError(const QString& message); void clearError(); void abortOperation(const QString& message); @@ -106,6 +106,7 @@ public Q_SLOTS: WalletModel* const m_wallet_model; const uint256 m_protx_hash; const std::vector m_operator_pubkey; + const bool m_is_shared; MasternodeOperationRunner* const m_runner; protected Q_SLOTS: diff --git a/src/qt/sharedmndialogs.cpp b/src/qt/sharedmndialogs.cpp index afd83188146a..10e867626b90 100644 --- a/src/qt/sharedmndialogs.cpp +++ b/src/qt/sharedmndialogs.cpp @@ -317,7 +317,6 @@ bool ComputeSharedSignHash(SharedSigCollector::Kind kind, const QString& pro_tx_ UpdateShareDialog::UpdateShareDialog(interfaces::Node& node, WalletModel* wallet_model, const MasternodeEntry& entry, QWidget* parent) : MasternodeActionDialog(node, wallet_model, entry, parent), m_v24_active{node.isV24Active()}, - m_is_shared{entry.isShared()}, m_voting_address{entry.votingAddress()}, m_shares{entry.shares()} { diff --git a/src/qt/sharedmndialogs.h b/src/qt/sharedmndialogs.h index a39536f6f846..8ef926ffb1d5 100644 --- a/src/qt/sharedmndialogs.h +++ b/src/qt/sharedmndialogs.h @@ -64,7 +64,6 @@ class UpdateShareDialog : public MasternodeActionDialog void useNewAddress(); const bool m_v24_active; - const bool m_is_shared; const QString m_voting_address; const std::vector m_shares; diff --git a/src/qt/test/masternodemaintenancetests.cpp b/src/qt/test/masternodemaintenancetests.cpp index 2b9079281a7a..0246c06587c9 100644 --- a/src/qt/test/masternodemaintenancetests.cpp +++ b/src/qt/test/masternodemaintenancetests.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -300,6 +301,39 @@ void MasternodeMaintenanceTests::automaticFeeSource() const auto shared_revocation{shared_revoke.buildRequest(shared->operatorSecret(), error)}; QVERIFY2(shared_revocation.has_value(), qPrintable(error)); QVERIFY(shared_revocation->fee_source == std::optional{funded}); + + const auto empty_wallet{MakeTestWallet(m_node, context, "unfunded_operator")}; + QVERIFY(empty_wallet != nullptr); + guard.keep(empty_wallet); + WalletModel empty_model(interfaces::MakeWallet(context, empty_wallet), models.client); + UpdateServiceDialog unfunded_service(m_node, &empty_model, shared_entry, capabilities, nullptr); + RevokeDialog unfunded_revoke(m_node, &empty_model, shared_entry, nullptr); + auto check_fee_selection = [&](MasternodeActionDialog& dialog, bool has_funds) { + auto* key_widget = dialog.findChild(); + QVERIFY(key_widget); + key_widget->findChild()->setText(QString::fromStdString(shared->operatorSecret().ToString(false))); + QVERIFY(key_widget->isValid()); + auto* fee_picker = dialog.findChild(); + auto* buttons = dialog.findChild(); + QVERIFY(fee_picker); + QVERIFY(buttons); + QCOMPARE(fee_picker->count(), has_funds ? 1 : 0); + auto* ok_button = buttons->button(QDialogButtonBox::Ok); + QCOMPARE(ok_button->isEnabled(), has_funds); + QCOMPARE(ok_button->toolTip().isEmpty(), has_funds); + if (has_funds) { + fee_picker->setCurrentIndex(-1); + QVERIFY(!ok_button->isEnabled()); + QVERIFY(!ok_button->toolTip().isEmpty()); + fee_picker->setCurrentIndex(0); + QVERIFY(ok_button->isEnabled()); + QVERIFY(ok_button->toolTip().isEmpty()); + } + }; + check_fee_selection(unfunded_service, false); + check_fee_selection(unfunded_revoke, false); + check_fee_selection(shared_service, true); + check_fee_selection(shared_revoke, true); } void MasternodeMaintenanceTests::operatorSecretValidation() From 85356dedf73218b0a40d087620027a38d9c2fff6 Mon Sep 17 00:00:00 2001 From: pasta Date: Fri, 13 Nov 2026 00:12:29 -0600 Subject: [PATCH 4/6] fix(qt): report PSBT save failures and handle an unknown PSBT fee Both PSBT save paths opened the file through QString::toLocal8Bit(), which loses characters outside the local code page on Windows, and reported success without checking the stream. Open the file through GUIUtil::QStringToPath and show an error if writing failed. renderTransaction dereferenced the optional fee to test whether it was set. That is undefined when the fee is unknown, and it showed a known zero fee as unknown. Test has_value() instead. Co-Authored-By: Claude Fable 5.2 --- src/qt/psbtoperationsdialog.cpp | 8 ++++++-- src/qt/sendcoinsdialog.cpp | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/qt/psbtoperationsdialog.cpp b/src/qt/psbtoperationsdialog.cpp index bc834508a130..b281d247173e 100644 --- a/src/qt/psbtoperationsdialog.cpp +++ b/src/qt/psbtoperationsdialog.cpp @@ -160,9 +160,13 @@ void PSBTOperationsDialog::saveTransaction() { if (filename.isEmpty()) { return; } - std::ofstream out{filename.toLocal8Bit().data(), std::ofstream::out | std::ofstream::binary}; + std::ofstream out(GUIUtil::QStringToPath(filename), std::ofstream::out | std::ofstream::binary); out << ssTx.str(); out.close(); + if (!out) { + showStatus(tr("Failed to save PSBT to disk."), StatusLevel::ERR); + return; + } showStatus(tr("PSBT saved to disk."), StatusLevel::INFO); } @@ -190,7 +194,7 @@ QString PSBTOperationsDialog::renderTransaction(const PartiallySignedTransaction PSBTAnalysis analysis = AnalyzePSBT(psbtx); tx_description.append(bullet_point); - if (!*analysis.fee) { + if (!analysis.fee.has_value()) { // This happens if the transaction is missing input UTXO information. tx_description.append(tr("Unable to calculate transaction fee or total transaction amount.")); } else { diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 26208556083b..1e98d87460cd 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -528,9 +528,13 @@ void SendCoinsDialog::presentPSBT(PartiallySignedTransaction& psbtx) if (filename.isEmpty()) { return; } - std::ofstream out{filename.toLocal8Bit().data(), std::ofstream::out | std::ofstream::binary}; + std::ofstream out(GUIUtil::QStringToPath(filename), std::ofstream::out | std::ofstream::binary); out << ssTx.str(); out.close(); + if (!out) { + Q_EMIT message(tr("PSBT save failed"), tr("Failed to save PSBT to disk"), CClientUIInterface::MSG_ERROR); + break; + } //: Popup message when a PSBT has been saved to a file Q_EMIT message(tr("PSBT saved"), tr("PSBT saved to disk"), CClientUIInterface::MSG_INFORMATION); break; From 353765c5700d4023fd24bddc9424ce911197682c Mon Sep 17 00:00:00 2001 From: pasta Date: Fri, 13 Nov 2026 00:12:29 -0600 Subject: [PATCH 5/6] fix(qt): keep the CoinJoin send tab away from the saved change address The CoinJoin send dialog shares SendCoinsDialog with the regular send tab. With "keep custom change address" enabled it loaded the regular tab's saved change address, and on shutdown it overwrote that setting with its own field. Skip both for the CoinJoin dialog. Co-Authored-By: Claude Fable 5.2 --- src/qt/sendcoinsdialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 1e98d87460cd..b83f75714cd9 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -190,7 +190,7 @@ void SendCoinsDialog::setModel(WalletModel *_model) fKeepChangeAddress = _model->getOptionsModel()->getKeepChangeAddress(); QSettings settings; - if (fKeepChangeAddress && settings.contains("sCustomChangeAddress")) { + if (!m_coin_control->IsUsingCoinJoin() && fKeepChangeAddress && settings.contains("sCustomChangeAddress")) { ui->checkBoxCoinControlChange->setChecked(true); ui->lineEditCoinControlChange->setText(settings.value("sCustomChangeAddress").toString()); coinControlChangeEdited(ui->lineEditCoinControlChange->text()); @@ -249,7 +249,7 @@ void SendCoinsDialog::setModel(WalletModel *_model) SendCoinsDialog::~SendCoinsDialog() { QSettings settings; - if (fKeepChangeAddress) { + if (fKeepChangeAddress && !m_coin_control->IsUsingCoinJoin()) { settings.setValue("sCustomChangeAddress", ui->lineEditCoinControlChange->text()); } settings.setValue("fFeeSectionMinimized", fFeeMinimized); From 86aa4ffc5c5eb4c3e7a7cfab83ad3b3478c5f2f8 Mon Sep 17 00:00:00 2001 From: pasta Date: Fri, 13 Nov 2026 00:12:29 -0600 Subject: [PATCH 6/6] fix(qt): retry the proposal feed and stop feeds with the client model ProposalFeed::fetch gave up when the masternode feed had no data yet, so the proposal list stayed empty until the next refresh trigger. Mark a retry as pending so the feed re-arms itself. ClientModel::stop left the feed workers running. Stop them there instead of waiting for the model's destructor. Co-Authored-By: Claude Fable 5.2 --- src/qt/clientfeeds.cpp | 1 + src/qt/clientmodel.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/qt/clientfeeds.cpp b/src/qt/clientfeeds.cpp index 3383c67a3b81..8460394913a8 100644 --- a/src/qt/clientfeeds.cpp +++ b/src/qt/clientfeeds.cpp @@ -211,6 +211,7 @@ void ProposalFeed::fetch() const auto data_mn = m_feed_masternode.data(); if (!data_mn || !data_mn->m_valid) { + m_retry_pending.store(true); return; } diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index 85b4b2d805a4..6169c8cee841 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -109,6 +109,8 @@ void ClientModel::stop() { unsubscribeFromCoreSignals(); + m_feeds->stop(); + m_thread->quit(); m_thread->wait(); }