From 61dae0ed6febf8fc9c19a507e43364b04e46613b Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 16 Nov 2024 12:59:53 +1000 Subject: [PATCH] Qt: Disable close for non-cancellable progress dialog --- src/duckstation-qt/qtprogresscallback.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/duckstation-qt/qtprogresscallback.cpp b/src/duckstation-qt/qtprogresscallback.cpp index fdc790aaf..fc803ee2a 100644 --- a/src/duckstation-qt/qtprogresscallback.cpp +++ b/src/duckstation-qt/qtprogresscallback.cpp @@ -19,6 +19,7 @@ QtModalProgressCallback::QtModalProgressCallback(QWidget* parent_widget, float s m_dialog.setModal(parent_widget != nullptr); m_dialog.setAutoClose(false); m_dialog.setAutoReset(false); + m_dialog.setWindowFlag(Qt::WindowCloseButtonHint, false); connect(&m_dialog, &QProgressDialog::canceled, this, &QtModalProgressCallback::dialogCancelled); checkForDelayedShow(); } @@ -31,6 +32,7 @@ void QtModalProgressCallback::SetCancellable(bool cancellable) return; ProgressCallback::SetCancellable(cancellable); + m_dialog.setWindowFlag(Qt::WindowCloseButtonHint, cancellable); m_dialog.setCancelButtonText(cancellable ? tr("Cancel") : QString()); }