diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-10-17 01:01:01 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-10-17 01:01:01 +0200 |
commit | 6f27bb135246b7fe9d11ba58e05d2b7661bc2080 (patch) | |
tree | 9704e1c4ffb775472a9984872c3bd292faa999a5 /examples/widgets/mainwindows | |
parent | dc4212b3a694e143595968419ae5ad695ab2aa03 (diff) | |
parent | c222a9283d94ad1e29334bb2fba0beef7cc716c7 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ica69de99be9c8af4d28a52e4b69e6af748ed983c
Diffstat (limited to 'examples/widgets/mainwindows')
-rw-r--r-- | examples/widgets/mainwindows/application/mainwindow.cpp | 2 | ||||
-rw-r--r-- | examples/widgets/mainwindows/mdi/mainwindow.cpp | 2 | ||||
-rw-r--r-- | examples/widgets/mainwindows/sdi/mainwindow.cpp | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/examples/widgets/mainwindows/application/mainwindow.cpp b/examples/widgets/mainwindows/application/mainwindow.cpp index 7886c4afac..d0c009427f 100644 --- a/examples/widgets/mainwindows/application/mainwindow.cpp +++ b/examples/widgets/mainwindows/application/mainwindow.cpp @@ -281,7 +281,7 @@ void MainWindow::readSettings() QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName()); const QByteArray geometry = settings.value("geometry", QByteArray()).toByteArray(); if (geometry.isEmpty()) { - const QRect availableGeometry = QApplication::desktop()->availableGeometry(this); + const QRect availableGeometry = screen()->availableGeometry(); resize(availableGeometry.width() / 3, availableGeometry.height() / 2); move((availableGeometry.width() - width()) / 2, (availableGeometry.height() - height()) / 2); diff --git a/examples/widgets/mainwindows/mdi/mainwindow.cpp b/examples/widgets/mainwindows/mdi/mainwindow.cpp index b952d19e2e..ccfa7435d7 100644 --- a/examples/widgets/mainwindows/mdi/mainwindow.cpp +++ b/examples/widgets/mainwindows/mdi/mainwindow.cpp @@ -464,7 +464,7 @@ void MainWindow::readSettings() QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName()); const QByteArray geometry = settings.value("geometry", QByteArray()).toByteArray(); if (geometry.isEmpty()) { - const QRect availableGeometry = QApplication::desktop()->availableGeometry(this); + const QRect availableGeometry = screen()->availableGeometry(); resize(availableGeometry.width() / 3, availableGeometry.height() / 2); move((availableGeometry.width() - width()) / 2, (availableGeometry.height() - height()) / 2); diff --git a/examples/widgets/mainwindows/sdi/mainwindow.cpp b/examples/widgets/mainwindows/sdi/mainwindow.cpp index a1fb42158e..c3cd131923 100644 --- a/examples/widgets/mainwindows/sdi/mainwindow.cpp +++ b/examples/widgets/mainwindows/sdi/mainwindow.cpp @@ -167,7 +167,7 @@ void MainWindow::tile(const QMainWindow *previous) if (!topFrameWidth) topFrameWidth = 40; const QPoint pos = previous->pos() + 2 * QPoint(topFrameWidth, topFrameWidth); - if (QApplication::desktop()->availableGeometry(this).contains(rect().bottomRight() + pos)) + if (screen()->availableGeometry().contains(rect().bottomRight() + pos)) move(pos); } @@ -290,7 +290,7 @@ void MainWindow::readSettings() QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName()); const QByteArray geometry = settings.value("geometry", QByteArray()).toByteArray(); if (geometry.isEmpty()) { - const QRect availableGeometry = QApplication::desktop()->availableGeometry(this); + const QRect availableGeometry = screen()->availableGeometry(); resize(availableGeometry.width() / 3, availableGeometry.height() / 2); move((availableGeometry.width() - width()) / 2, (availableGeometry.height() - height()) / 2); |