summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-09-03 19:58:21 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-09-09 20:20:01 +0000
commit07675d99008cdeb09aeb3c580e364c237245f471 (patch)
tree148c146097d6a1eb925bb61c33aab3e7ebf004be /src/widgets
parenteb1e13501a466d6394aba6094b27542606edd9ee (diff)
macOS: Don't show QMessageBox::about(Qt) as modal windows
The system behavior is to not show these kinds of dialogs as modal, and we've documented that for QMessageBox. However, calling show() instead of exec() is not enough, as the default constructor of QMessageBox will set the modality of the widget to application-modal. We need to explicitly override this. [ChangLog][macOS] QMessageBox::about(Qt) now shows dialog non-modal, as documented. Change-Id: I6bb59efb81feb23122276a9eede71b2f20c9d7c6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit aafed07dee5fd2d22518e49c4fa7798735e9e681) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index 7b6148b1d2..ac2f8bd2d5 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -1830,6 +1830,7 @@ void QMessageBox::about(QWidget *parent, const QString &title, const QString &te
#else
msgBox->d_func()->buttonBox->setCenterButtons(true);
#endif
+ msgBox->setModal(false);
msgBox->show();
#else
msgBox->exec();
@@ -1915,6 +1916,7 @@ void QMessageBox::aboutQt(QWidget *parent, const QString &title)
#else
msgBox->d_func()->buttonBox->setCenterButtons(true);
#endif
+ msgBox->setModal(false);
msgBox->show();
#else
msgBox->exec();