diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp index d29073985a2..035691f86a6 100644 --- a/src/widgets/dialogs/qmessagebox.cpp +++ b/src/widgets/dialogs/qmessagebox.cpp @@ -1819,9 +1819,10 @@ QMessageBox::StandardButton QMessageBox::critical(QWidget *parent, const QString \li As a last resort it uses the Information icon. \endlist - The about box has a single button labelled "OK". On \macos, the - about box is popped up as a modeless window; on other platforms, - it is currently application modal. + The about box has a single button labelled "OK". + + On \macos, the about box is popped up as a modeless window; on + other platforms, it is currently application modal. \sa QWidget::windowIcon(), QApplication::activeWindow() */ @@ -1851,8 +1852,13 @@ void QMessageBox::about(QWidget *parent, const QString &title, const QString &te // should perhaps be a style hint #ifdef Q_OS_MAC oldMsgBox = msgBox; - msgBox->d_func()->buttonBox->setCenterButtons(true); + auto *d = msgBox->d_func(); + d->buttonBox->setCenterButtons(true); +#ifdef Q_OS_IOS + msgBox->setModal(true); +#else msgBox->setModal(false); +#endif msgBox->show(); #else msgBox->exec(); @@ -1869,7 +1875,7 @@ void QMessageBox::about(QWidget *parent, const QString &title, const QString &te QApplication provides this functionality as a slot. - On \macos, the about box is popped up as a modeless window; on + On \macos, the aboutQt box is popped up as a modeless window; on other platforms, it is currently application modal. \sa QApplication::aboutQt() @@ -1932,8 +1938,13 @@ void QMessageBox::aboutQt(QWidget *parent, const QString &title) // should perhaps be a style hint #ifdef Q_OS_MAC oldMsgBox = msgBox; - msgBox->d_func()->buttonBox->setCenterButtons(true); + auto *d = msgBox->d_func(); + d->buttonBox->setCenterButtons(true); +#ifdef Q_OS_IOS + msgBox->setModal(true); +#else msgBox->setModal(false); +#endif msgBox->show(); #else msgBox->exec();