diff options
| author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-10-13 21:00:21 +0200 |
|---|---|---|
| committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-10-14 06:38:43 +0200 |
| commit | 1c76aa077e9c9d74fa2314752948896f9da381ee (patch) | |
| tree | ef979f532d759c9ae061c400415afd974d3edd26 /examples/opengl/hellogl2/main.cpp | |
| parent | 772a10391eead51e2c7c9b50473ef0f8096cef82 (diff) | |
Get rid of all usage of QApplication:desktop
Use QScreen APIs instead.
Change-Id: Ie99af94fe4292223dbb165b3f5c1b74e8fe0498b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'examples/opengl/hellogl2/main.cpp')
| -rw-r--r-- | examples/opengl/hellogl2/main.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/opengl/hellogl2/main.cpp b/examples/opengl/hellogl2/main.cpp index e0cffaf4c2b..96b96e77ee3 100644 --- a/examples/opengl/hellogl2/main.cpp +++ b/examples/opengl/hellogl2/main.cpp @@ -50,6 +50,7 @@ #include <QApplication> #include <QSurfaceFormat> +#include <QScreen> #include <QCommandLineParser> #include <QCommandLineOption> @@ -94,8 +95,8 @@ int main(int argc, char *argv[]) mainWindow.setAttribute(Qt::WA_NoSystemBackground, false); } mainWindow.resize(mainWindow.sizeHint()); - int desktopArea = QApplication::desktop()->width() * - QApplication::desktop()->height(); + int desktopArea = QGuiApplication::primaryScreen()->size().width() * + QGuiApplication::primaryScreen()->size().height(); int widgetArea = mainWindow.width() * mainWindow.height(); if (((float)widgetArea / (float)desktopArea) < 0.75f) mainWindow.show(); |
