diff --git a/examples/opengl/2dpainting/2dpainting.pro b/examples/opengl/2dpainting/2dpainting.pro index b9611f5b401..20fe4739a5f 100644 --- a/examples/opengl/2dpainting/2dpainting.pro +++ b/examples/opengl/2dpainting/2dpainting.pro @@ -1,4 +1,4 @@ -QT += widgets +QT += widgets opengl HEADERS = glwidget.h \ helper.h \ diff --git a/examples/opengl/cube/cube.pro b/examples/opengl/cube/cube.pro index b9416f1a9d8..07724e247e0 100644 --- a/examples/opengl/cube/cube.pro +++ b/examples/opengl/cube/cube.pro @@ -1,4 +1,4 @@ -QT += core gui widgets +QT += core gui widgets opengl TARGET = cube TEMPLATE = app diff --git a/examples/opengl/hellogl2/hellogl2.pro b/examples/opengl/hellogl2/hellogl2.pro index 3a52e04d747..834ae82e1fb 100644 --- a/examples/opengl/hellogl2/hellogl2.pro +++ b/examples/opengl/hellogl2/hellogl2.pro @@ -8,7 +8,7 @@ SOURCES = glwidget.cpp \ mainwindow.cpp \ logo.cpp -QT += widgets +QT += widgets opengl # install target.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl2 diff --git a/examples/opengl/qopenglwidget/qopenglwidget.pro b/examples/opengl/qopenglwidget/qopenglwidget.pro index 0165285c02d..1df3de12902 100644 --- a/examples/opengl/qopenglwidget/qopenglwidget.pro +++ b/examples/opengl/qopenglwidget/qopenglwidget.pro @@ -1,4 +1,4 @@ -QT += widgets +QT += widgets opengl SOURCES += main.cpp \ glwidget.cpp \ diff --git a/examples/opengl/textures/textures.pro b/examples/opengl/textures/textures.pro index 7a7d19bee63..ae1ae4d34c1 100644 --- a/examples/opengl/textures/textures.pro +++ b/examples/opengl/textures/textures.pro @@ -6,7 +6,7 @@ SOURCES = glwidget.cpp \ RESOURCES = textures.qrc -QT += widgets +QT += widgets opengl # install target.path = $$[QT_INSTALL_EXAMPLES]/opengl/textures diff --git a/examples/opengl/threadedqopenglwidget/threadedqopenglwidget.pro b/examples/opengl/threadedqopenglwidget/threadedqopenglwidget.pro index 4e941b28c42..70694459b2d 100644 --- a/examples/opengl/threadedqopenglwidget/threadedqopenglwidget.pro +++ b/examples/opengl/threadedqopenglwidget/threadedqopenglwidget.pro @@ -1,4 +1,4 @@ -QT += widgets +QT += widgets opengl SOURCES += main.cpp \ glwidget.cpp \ diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro index 820e46ed79e..eaa10de22a1 100644 --- a/src/opengl/opengl.pro +++ b/src/opengl/opengl.pro @@ -1,5 +1,6 @@ TARGET = QtOpenGL QT = core-private gui-private +qtConfig(widgets): QT += widgets widgets-private DEFINES += QT_NO_USING_NAMESPACE QT_NO_FOREACH @@ -23,4 +24,9 @@ SOURCES += \ SOURCES += qopengltimerquery.cpp } +qtConfig(widgets) { + HEADERS += qopenglwidget.h + SOURCES += qopenglwidget.cpp +} + load(qt_module) diff --git a/src/widgets/kernel/qopenglwidget.cpp b/src/opengl/qopenglwidget.cpp similarity index 99% rename from src/widgets/kernel/qopenglwidget.cpp rename to src/opengl/qopenglwidget.cpp index 90622fd21ee..a6c63ae034e 100644 --- a/src/widgets/kernel/qopenglwidget.cpp +++ b/src/opengl/qopenglwidget.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtWidgets module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE /*! \class QOpenGLWidget - \inmodule QtWidgets + \inmodule QtOpenGL \since 5.4 \brief The QOpenGLWidget class is a widget for rendering OpenGL graphics. diff --git a/src/widgets/kernel/qopenglwidget.h b/src/opengl/qopenglwidget.h similarity index 95% rename from src/widgets/kernel/qopenglwidget.h rename to src/opengl/qopenglwidget.h index 9eb4a9ba5ae..b331880b5dd 100644 --- a/src/widgets/kernel/qopenglwidget.h +++ b/src/opengl/qopenglwidget.h @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtWidgets module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -40,7 +40,7 @@ #ifndef QOPENGLWIDGET_H #define QOPENGLWIDGET_H -#include +#include #ifndef QT_NO_OPENGL @@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE class QOpenGLWidgetPrivate; -class Q_WIDGETS_EXPORT QOpenGLWidget : public QWidget +class Q_OPENGL_EXPORT QOpenGLWidget : public QWidget { Q_OBJECT Q_DECLARE_PRIVATE(QOpenGLWidget) diff --git a/src/widgets/kernel/kernel.pri b/src/widgets/kernel/kernel.pri index 58107973d8a..a9602809599 100644 --- a/src/widgets/kernel/kernel.pri +++ b/src/widgets/kernel/kernel.pri @@ -68,11 +68,6 @@ qtConfig(action) { kernel/qwidgetaction.cpp } -qtConfig(opengl) { - HEADERS += kernel/qopenglwidget.h - SOURCES += kernel/qopenglwidget.cpp -} - qtConfig(formlayout) { HEADERS += kernel/qformlayout.h SOURCES += kernel/qformlayout.cpp diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro b/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro index 8ed19697a4e..e95cdcf7d8c 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro +++ b/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro @@ -4,6 +4,7 @@ TARGET = tst_qgraphicsview QT += widgets widgets-private testlib QT += core-private gui-private testlib-private +qtConfig(opengl): QT += opengl SOURCES += tst_qgraphicsview.cpp tst_qgraphicsview_2.cpp HEADERS += tst_qgraphicsview.h diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp index ea89e2422b2..d521c6f11c7 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp @@ -48,8 +48,8 @@ #include #include #include -#ifndef QT_NO_OPENGL -#include +#if QT_CONFIG(opengl) +#include #endif #include #include @@ -154,7 +154,7 @@ private slots: void sceneRect_growing(); void setSceneRect(); void viewport(); -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) void openGLViewport(); #endif void dragMode_scrollHand(); @@ -659,7 +659,7 @@ void tst_QGraphicsView::viewport() QVERIFY(QTest::qWaitForWindowExposed(&view)); } -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) void tst_QGraphicsView::openGLViewport() { if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL)) diff --git a/tests/auto/widgets/widgets/qopenglwidget/qopenglwidget.pro b/tests/auto/widgets/widgets/qopenglwidget/qopenglwidget.pro index 2d4cff9e10d..039f5a71b8f 100644 --- a/tests/auto/widgets/widgets/qopenglwidget/qopenglwidget.pro +++ b/tests/auto/widgets/widgets/qopenglwidget/qopenglwidget.pro @@ -1,5 +1,5 @@ CONFIG += testcase TARGET = tst_qopenglwidget -QT += gui-private core-private testlib widgets +QT += opengl gui-private core-private testlib widgets SOURCES += tst_qopenglwidget.cpp diff --git a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp index 17a5fe2cd9e..e96e2925254 100644 --- a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp +++ b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp @@ -26,7 +26,7 @@ ** ****************************************************************************/ -#include +#include #include #include #include