QMessageBox::about / aboutQt - use native modal dialog on iOS
The about / aboutQt statics in QMessageBox used a non-native, non-modal dialog box on all operating systems. This creates a grid layout with labels for heading, text and icon. This has two unwanted side-effects on iOS: - When the screen size is not sufficient to display all text, the text is not rendered. On an iPhone SE for example, only the Qt icon is visible. - When the screen height exceeds the minimum requirement, the informative text is bottom-aligned. => Show about(Qt) message boxes in a modal, native dialog. => Update documentation. This partly reverts aafed07dee5fd2d22518e49c4fa7798735e9e681. [ChangeLog][iOS] QMessageBox::about(Qt) now shows native, modal dialog. Fixes: QTBUG-115832 Pick-to: 6.5 6.2 Change-Id: I4cfbce416e7d2717058bef9a050a85d424b8a03d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 6f5136ef6661150046b64992fb78b23f02da0ef2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
7ac5927e50
commit
29d20a781c
@ -1910,9 +1910,10 @@ QMessageBox::StandardButton QMessageBox::critical(QWidget *parent, const QString
|
|||||||
\li As a last resort it uses the Information icon.
|
\li As a last resort it uses the Information icon.
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
The about box has a single button labelled "OK". On \macos, the
|
The about box has a single button labelled "OK".
|
||||||
about box is popped up as a modeless window; on other platforms,
|
|
||||||
it is currently application modal.
|
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()
|
\sa QWidget::windowIcon(), QApplication::activeWindow()
|
||||||
*/
|
*/
|
||||||
@ -1942,8 +1943,13 @@ void QMessageBox::about(QWidget *parent, const QString &title, const QString &te
|
|||||||
// should perhaps be a style hint
|
// should perhaps be a style hint
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
oldMsgBox = msgBox;
|
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);
|
msgBox->setModal(false);
|
||||||
|
#endif
|
||||||
msgBox->show();
|
msgBox->show();
|
||||||
#else
|
#else
|
||||||
msgBox->exec();
|
msgBox->exec();
|
||||||
@ -1960,7 +1966,7 @@ void QMessageBox::about(QWidget *parent, const QString &title, const QString &te
|
|||||||
|
|
||||||
QApplication provides this functionality as a slot.
|
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.
|
other platforms, it is currently application modal.
|
||||||
|
|
||||||
\sa QApplication::aboutQt()
|
\sa QApplication::aboutQt()
|
||||||
@ -2023,8 +2029,13 @@ void QMessageBox::aboutQt(QWidget *parent, const QString &title)
|
|||||||
// should perhaps be a style hint
|
// should perhaps be a style hint
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
oldMsgBox = msgBox;
|
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);
|
msgBox->setModal(false);
|
||||||
|
#endif
|
||||||
msgBox->show();
|
msgBox->show();
|
||||||
#else
|
#else
|
||||||
msgBox->exec();
|
msgBox->exec();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user