From d2068b24e4b2e96832af154d02e19b5333880c21 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Wed, 19 Feb 2020 11:14:46 +0100 Subject: [PATCH] Manual tests: Port diaglib from QGL to QOpenGL Task-number: QTBUG-74408 Change-Id: I25dedd69c6927e5d627f8104c404e23ce68487d9 Reviewed-by: Eirik Aavitsland --- tests/manual/diaglib/diaglib.pri | 2 +- tests/manual/diaglib/glinfo.cpp | 17 ++++------------- tests/manual/foreignwindows/foreignwindows.pro | 2 +- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/tests/manual/diaglib/diaglib.pri b/tests/manual/diaglib/diaglib.pri index ace9caecc63..dd5bfa5330d 100644 --- a/tests/manual/diaglib/diaglib.pri +++ b/tests/manual/diaglib/diaglib.pri @@ -38,7 +38,7 @@ contains(QT, opengl) { SOURCES += \ $$PWD/glinfo.cpp - QT += opengl + QT += opengl openglwidgets } DEFINES += QT_DIAG_LIB diff --git a/tests/manual/diaglib/glinfo.cpp b/tests/manual/diaglib/glinfo.cpp index a955dd80ac0..d8aec5298a9 100644 --- a/tests/manual/diaglib/glinfo.cpp +++ b/tests/manual/diaglib/glinfo.cpp @@ -28,12 +28,11 @@ #include "glinfo.h" -#include -#include +#include +#include #if QT_VERSION > 0x050000 # if QT_VERSION >= 0x050400 -# include -# include +# include # else // 5.4 # include # endif // 5.0..5.4 @@ -63,11 +62,6 @@ static QString glInfo(const QOpenGLContext *ctx) + getGlString(ctx, GL_RENDERER); } -static QString glInfo(const QGLContext *ctx) -{ - return glInfo(ctx->contextHandle()); -} - QString glInfo(const QObject *o) { # if QT_VERSION >= 0x050400 @@ -76,11 +70,8 @@ QString glInfo(const QObject *o) return glInfo(oglw->context()); return QString(); } -# endif // 5.4 + if (o->isWidgetType()) { - if (const QGLWidget *g = qobject_cast(o)) - return glInfo(g->context()); -# if QT_VERSION >= 0x050400 if (const QOpenGLWidget *g = qobject_cast(o)) return glInfo(g->context()); # endif // 5.4 diff --git a/tests/manual/foreignwindows/foreignwindows.pro b/tests/manual/foreignwindows/foreignwindows.pro index 15bf2395f80..b78931bf7a0 100644 --- a/tests/manual/foreignwindows/foreignwindows.pro +++ b/tests/manual/foreignwindows/foreignwindows.pro @@ -1,5 +1,5 @@ TEMPLATE = app -QT += widgets +QT += widgets opengl CONFIG += cmdline c++11 SOURCES += main.cpp include(../diaglib/diaglib.pri)