ThreadedOpenGL example: use std::unique_ptr instead of QScopedPointer

There's talk that QScopedPointer may be deprecated. Don't use it
in examples anymore.

Change-Id: I05a486c2a86fcc7015a9c21ed0ce9682b0c24034
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This commit is contained in:
Marc Mutz 2019-05-14 20:42:01 +02:00
parent bc6ffcd0c5
commit 4715d6db80

View File

@ -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))
@ -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);