From 4e7bb0488a5186aa09ab2072b8b610b19d1ff6ce Mon Sep 17 00:00:00 2001 From: OBattler Date: Fri, 23 Jan 2026 09:28:10 +0100 Subject: [PATCH] Hard reset dialog: Rely on clicked button instead of role. --- src/qt/qt_mainwindow.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index 08c001ff7..f6195389c 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -1218,8 +1218,8 @@ MainWindow::on_actionHard_Reset_triggered() if (confirm_reset) { QMessageBox questionbox(QMessageBox::Icon::Question, "86Box", tr("Are you sure you want to hard reset the emulated machine?"), QMessageBox::NoButton, this); questionbox.addButton(tr("Reset"), QMessageBox::AcceptRole); - questionbox.addButton(tr("Don't reset"), QMessageBox::RejectRole); - const auto chkbox = new QCheckBox(tr("Don't show this message again")); + auto no_reset_button = questionbox.addButton(tr("Don't reset"), QMessageBox::RejectRole); + const auto chkbox = new QCheckBox(tr("Don't show this message again")); questionbox.setCheckBox(chkbox); chkbox->setChecked(!confirm_reset); @@ -1227,7 +1227,7 @@ MainWindow::on_actionHard_Reset_triggered() confirm_reset = (state == Qt::CheckState::Unchecked); }); questionbox.exec(); - if (questionbox.result() == QDialog::Accepted) { + if (questionbox.clickedButton() == no_reset_button) { confirm_reset = true; return; }