summaryrefslogtreecommitdiffstats
path: root/examples/opengl/hellogl2/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/opengl/hellogl2/main.cpp')
-rw-r--r--examples/opengl/hellogl2/main.cpp5
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();