summaryrefslogtreecommitdiffstats
path: root/examples/opengl/threadedqopenglwidget/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/opengl/threadedqopenglwidget/main.cpp')
-rw-r--r--examples/opengl/threadedqopenglwidget/main.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/opengl/threadedqopenglwidget/main.cpp b/examples/opengl/threadedqopenglwidget/main.cpp
index b9e491040f..975def030b 100644
--- a/examples/opengl/threadedqopenglwidget/main.cpp
+++ b/examples/opengl/threadedqopenglwidget/main.cpp
@@ -50,7 +50,7 @@
#include <QApplication>
#include <QMainWindow>
-#include <QDesktopWidget>
+#include <QScreen>
#include <QSurfaceFormat>
#include <QOpenGLContext>
#include <QCommandLineParser>
@@ -58,6 +58,8 @@
#include "mainwindow.h"
#include "glwidget.h"
+#include <memory>
+
static QString getGlString(QOpenGLFunctions *functions, GLenum name)
{
if (const GLubyte *p = functions->glGetString(name))
@@ -88,7 +90,7 @@ int main( int argc, char ** argv )
// The rendering for the four QOpenGLWidgets happens on four separate threads.
GLWidget topLevelGlWidget;
- QPoint pos = QApplication::desktop()->availableGeometry(&topLevelGlWidget).topLeft() + QPoint(200, 200);
+ QPoint pos = topLevelGlWidget.screen()->availableGeometry().topLeft() + QPoint(200, 200);
topLevelGlWidget.setWindowTitle(QStringLiteral("Threaded QOpenGLWidget example top level"));
topLevelGlWidget.resize(200, 200);
topLevelGlWidget.move(pos);
@@ -104,8 +106,8 @@ int main( int argc, char ** argv )
const QString toolTip = supportsThreading ? glInfo : glInfo + QStringLiteral("\ndoes not support threaded OpenGL.");
topLevelGlWidget.setToolTip(toolTip);
- QScopedPointer<MainWindow> mw1;
- QScopedPointer<MainWindow> mw2;
+ std::unique_ptr<MainWindow> mw1;
+ std::unique_ptr<MainWindow> mw2;
if (!parser.isSet(singleOption)) {
if (supportsThreading) {
pos += QPoint(100, 100);