Examples: use QDialog::showMaximaized() for Android

Examples that use QDialog as main window should be maximized on Android
to avoid a black view on most of the screen.

Task-number: QTBUG-80717
Change-Id: I933c1a01d95d53da009c190c37fa32f27be5af5e
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
bb10
Assam Boudjelthia 2020-02-24 09:50:51 +02:00
parent 275401f580
commit 873eba3f8b
3 changed files with 14 additions and 1 deletions

View File

@ -81,7 +81,11 @@ int main(int argc, char *argv[])
const QRect availableSize = httpWin.screen()->availableGeometry();
httpWin.resize(availableSize.width() / 5, availableSize.height() / 5);
httpWin.move((availableSize.width() - httpWin.width()) / 2, (availableSize.height() - httpWin.height()) / 2);
#ifdef Q_OS_ANDROID
httpWin.showMaximized();
#else
httpWin.show();
#endif
return app.exec();
}

View File

@ -56,7 +56,11 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Dialog dialog;
#ifdef Q_OS_ANDROID
dialog.showMaximized();
#else
dialog.show();
#endif
return app.exec();
}

View File

@ -56,6 +56,11 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Dialog dialog;
#ifdef Q_OS_ANDROID
dialog.showMaximized();
#else
dialog.show();
#endif
return app.exec();
}