From 0c8220c9fdbbf0a8b904ce1b98b5a1af39b068d4 Mon Sep 17 00:00:00 2001 From: summer <79678786+summerqB@users.noreply.github.com> Date: Sun, 1 May 2022 21:20:00 +0800 Subject: [PATCH] Prevent the new update box from blocking input on other dialogues PR #16678. --- src/gui/mainwindow.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 1ad507824..fa660efeb 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -1920,6 +1920,7 @@ void MainWindow::handleUpdateCheckFinished(ProgramUpdater *updater, const bool i msgBox->setAttribute(Qt::WA_DeleteOnClose); msgBox->setAttribute(Qt::WA_ShowWithoutActivating); msgBox->setDefaultButton(QMessageBox::Yes); + msgBox->setWindowModality(Qt::NonModal); connect(msgBox, &QMessageBox::buttonClicked, this, [msgBox, updater](QAbstractButton *button) { if (msgBox->buttonRole(button) == QMessageBox::YesRole) @@ -1928,7 +1929,7 @@ void MainWindow::handleUpdateCheckFinished(ProgramUpdater *updater, const bool i } }); connect(msgBox, &QDialog::finished, this, cleanup); - msgBox->open(); + msgBox->show(); } else { @@ -1938,8 +1939,9 @@ void MainWindow::handleUpdateCheckFinished(ProgramUpdater *updater, const bool i , tr("No updates available.\nYou are already using the latest version.") , QMessageBox::Ok, this}; msgBox->setAttribute(Qt::WA_DeleteOnClose); + msgBox->setWindowModality(Qt::NonModal); connect(msgBox, &QDialog::finished, this, cleanup); - msgBox->open(); + msgBox->show(); } else {