summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2020-02-04 11:47:39 +0100
committerJohan Klokkhammer Helsing <johan.helsing@qt.io>2020-02-18 09:22:51 +0100
commit00eeed234f7c4cfc357b17424e0dcd714ff65e70 (patch)
tree19f93238e01638c519dbf6a15bd20768fab39aa6
parent077959972b6eb6fab55d08f955e4eeade48c09a9 (diff)
Move QOpenGLWidget from QtOpenGL to its own module
Same pattern as QtQuickWidgets. Gets rid of QtOpenGL's dependency on QtWidgets. Task-number: QTBUG-74409 Change-Id: I4f9b55c23e25a1e0519734037b768a16e870c7d2 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r--examples/opengl/2dpainting/2dpainting.pro2
-rw-r--r--examples/opengl/2dpainting/CMakeLists.txt2
-rw-r--r--examples/opengl/cube/CMakeLists.txt2
-rw-r--r--examples/opengl/cube/cube.pro2
-rw-r--r--examples/opengl/hellogl2/CMakeLists.txt2
-rw-r--r--examples/opengl/hellogl2/hellogl2.pro2
-rw-r--r--examples/opengl/qopenglwidget/CMakeLists.txt2
-rw-r--r--examples/opengl/qopenglwidget/qopenglwidget.pro2
-rw-r--r--examples/opengl/textures/CMakeLists.txt2
-rw-r--r--examples/opengl/textures/textures.pro2
-rw-r--r--examples/opengl/threadedqopenglwidget/CMakeLists.txt2
-rw-r--r--examples/opengl/threadedqopenglwidget/threadedqopenglwidget.pro2
-rw-r--r--examples/widgets/graphicsview/padnavigator/.prev_CMakeLists.txt1
-rw-r--r--examples/widgets/graphicsview/padnavigator/CMakeLists.txt1
-rw-r--r--examples/widgets/graphicsview/padnavigator/padnavigator.pro2
-rw-r--r--src/CMakeLists.txt3
-rw-r--r--src/opengl/CMakeLists.txt11
-rw-r--r--src/opengl/opengl.pro6
-rw-r--r--src/openglwidgets/CMakeLists.txt19
-rw-r--r--src/openglwidgets/openglwidgets.pro13
-rw-r--r--src/openglwidgets/qopenglwidget.cpp (renamed from src/opengl/qopenglwidget.cpp)4
-rw-r--r--src/openglwidgets/qopenglwidget.h (renamed from src/opengl/qopenglwidget.h)10
-rw-r--r--src/openglwidgets/qtopenglwidgetsglobal.h59
-rw-r--r--src/src.pro8
-rw-r--r--sync.profile1
-rw-r--r--tests/auto/widgets/graphicsview/CMakeLists.txt11
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/CMakeLists.txt1
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp2
-rw-r--r--tests/auto/widgets/widgets/qopenglwidget/CMakeLists.txt1
-rw-r--r--tests/auto/widgets/widgets/qopenglwidget/qopenglwidget.pro2
-rw-r--r--tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp2
-rw-r--r--util/cmake/helper.py1
33 files changed, 141 insertions, 43 deletions
diff --git a/examples/opengl/2dpainting/2dpainting.pro b/examples/opengl/2dpainting/2dpainting.pro
index 20fe4739a5..751c2022fd 100644
--- a/examples/opengl/2dpainting/2dpainting.pro
+++ b/examples/opengl/2dpainting/2dpainting.pro
@@ -1,4 +1,4 @@
-QT += widgets opengl
+QT += widgets opengl openglwidgets
HEADERS = glwidget.h \
helper.h \
diff --git a/examples/opengl/2dpainting/CMakeLists.txt b/examples/opengl/2dpainting/CMakeLists.txt
index 1144830659..31f8005a19 100644
--- a/examples/opengl/2dpainting/CMakeLists.txt
+++ b/examples/opengl/2dpainting/CMakeLists.txt
@@ -15,6 +15,7 @@ find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Widgets)
find_package(Qt6 COMPONENTS OpenGL)
+find_package(Qt6 COMPONENTS OpenGLWidgets)
add_qt_gui_executable(2dpainting
glwidget.cpp glwidget.h
@@ -27,6 +28,7 @@ target_link_libraries(2dpainting PUBLIC
Qt::Core
Qt::Gui
Qt::OpenGL
+ Qt::OpenGLWidgets
Qt::Widgets
)
diff --git a/examples/opengl/cube/CMakeLists.txt b/examples/opengl/cube/CMakeLists.txt
index cb7c78080e..2d0d0f7887 100644
--- a/examples/opengl/cube/CMakeLists.txt
+++ b/examples/opengl/cube/CMakeLists.txt
@@ -15,6 +15,7 @@ find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Widgets)
find_package(Qt6 COMPONENTS OpenGL)
+find_package(Qt6 COMPONENTS OpenGLWidgets)
add_qt_gui_executable(cube
geometryengine.cpp geometryengine.h
@@ -25,6 +26,7 @@ target_link_libraries(cube PUBLIC
Qt::Core
Qt::Gui
Qt::OpenGL
+ Qt::OpenGLWidgets
Qt::Widgets
)
diff --git a/examples/opengl/cube/cube.pro b/examples/opengl/cube/cube.pro
index 07724e247e..95a411322a 100644
--- a/examples/opengl/cube/cube.pro
+++ b/examples/opengl/cube/cube.pro
@@ -1,4 +1,4 @@
-QT += core gui widgets opengl
+QT += core gui widgets opengl openglwidgets
TARGET = cube
TEMPLATE = app
diff --git a/examples/opengl/hellogl2/CMakeLists.txt b/examples/opengl/hellogl2/CMakeLists.txt
index 5df3c811e5..798a83594e 100644
--- a/examples/opengl/hellogl2/CMakeLists.txt
+++ b/examples/opengl/hellogl2/CMakeLists.txt
@@ -15,6 +15,7 @@ find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Widgets)
find_package(Qt6 COMPONENTS OpenGL)
+find_package(Qt6 COMPONENTS OpenGLWidgets)
add_qt_gui_executable(hellogl2
glwidget.cpp glwidget.h
@@ -27,6 +28,7 @@ target_link_libraries(hellogl2 PUBLIC
Qt::Core
Qt::Gui
Qt::OpenGL
+ Qt::OpenGLWidgets
Qt::Widgets
)
diff --git a/examples/opengl/hellogl2/hellogl2.pro b/examples/opengl/hellogl2/hellogl2.pro
index 834ae82e1f..d7cd38de53 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 opengl
+QT += widgets opengl openglwidgets
# install
target.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl2
diff --git a/examples/opengl/qopenglwidget/CMakeLists.txt b/examples/opengl/qopenglwidget/CMakeLists.txt
index 586bd7130a..10b30f9461 100644
--- a/examples/opengl/qopenglwidget/CMakeLists.txt
+++ b/examples/opengl/qopenglwidget/CMakeLists.txt
@@ -15,6 +15,7 @@ find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Widgets)
find_package(Qt6 COMPONENTS OpenGL)
+find_package(Qt6 COMPONENTS OpenGLWidgets)
add_qt_gui_executable(qopenglwidget
bubble.cpp bubble.h
@@ -26,6 +27,7 @@ target_link_libraries(qopenglwidget PUBLIC
Qt::Core
Qt::Gui
Qt::OpenGL
+ Qt::OpenGLWidgets
Qt::Widgets
)
diff --git a/examples/opengl/qopenglwidget/qopenglwidget.pro b/examples/opengl/qopenglwidget/qopenglwidget.pro
index 1df3de1290..7ac546d7ce 100644
--- a/examples/opengl/qopenglwidget/qopenglwidget.pro
+++ b/examples/opengl/qopenglwidget/qopenglwidget.pro
@@ -1,4 +1,4 @@
-QT += widgets opengl
+QT += widgets opengl openglwidgets
SOURCES += main.cpp \
glwidget.cpp \
diff --git a/examples/opengl/textures/CMakeLists.txt b/examples/opengl/textures/CMakeLists.txt
index 8e4f7788e1..1bb4ae6240 100644
--- a/examples/opengl/textures/CMakeLists.txt
+++ b/examples/opengl/textures/CMakeLists.txt
@@ -15,6 +15,7 @@ find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Widgets)
find_package(Qt6 COMPONENTS OpenGL)
+find_package(Qt6 COMPONENTS OpenGLWidgets)
add_qt_gui_executable(textures
glwidget.cpp glwidget.h
@@ -25,6 +26,7 @@ target_link_libraries(textures PUBLIC
Qt::Core
Qt::Gui
Qt::OpenGL
+ Qt::OpenGLWidgets
Qt::Widgets
)
diff --git a/examples/opengl/textures/textures.pro b/examples/opengl/textures/textures.pro
index ae1ae4d34c..d2a6506cb8 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 opengl
+QT += widgets opengl openglwidgets
# install
target.path = $$[QT_INSTALL_EXAMPLES]/opengl/textures
diff --git a/examples/opengl/threadedqopenglwidget/CMakeLists.txt b/examples/opengl/threadedqopenglwidget/CMakeLists.txt
index a295c63f71..f5368f89ef 100644
--- a/examples/opengl/threadedqopenglwidget/CMakeLists.txt
+++ b/examples/opengl/threadedqopenglwidget/CMakeLists.txt
@@ -15,6 +15,7 @@ find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Widgets)
find_package(Qt6 COMPONENTS OpenGL)
+find_package(Qt6 COMPONENTS OpenGLWidgets)
add_qt_gui_executable(threadedqopenglwidget
glwidget.cpp glwidget.h
@@ -25,6 +26,7 @@ target_link_libraries(threadedqopenglwidget PUBLIC
Qt::Core
Qt::Gui
Qt::OpenGL
+ Qt::OpenGLWidgets
Qt::Widgets
)
diff --git a/examples/opengl/threadedqopenglwidget/threadedqopenglwidget.pro b/examples/opengl/threadedqopenglwidget/threadedqopenglwidget.pro
index 70694459b2..a62fbeb9c2 100644
--- a/examples/opengl/threadedqopenglwidget/threadedqopenglwidget.pro
+++ b/examples/opengl/threadedqopenglwidget/threadedqopenglwidget.pro
@@ -1,4 +1,4 @@
-QT += widgets opengl
+QT += widgets opengl openglwidgets
SOURCES += main.cpp \
glwidget.cpp \
diff --git a/examples/widgets/graphicsview/padnavigator/.prev_CMakeLists.txt b/examples/widgets/graphicsview/padnavigator/.prev_CMakeLists.txt
index 748e1e27f3..6514f07a5a 100644
--- a/examples/widgets/graphicsview/padnavigator/.prev_CMakeLists.txt
+++ b/examples/widgets/graphicsview/padnavigator/.prev_CMakeLists.txt
@@ -53,6 +53,7 @@ qt6_add_resources(padnavigator "padnavigator"
if(TARGET Qt::OpenGL)
target_link_libraries(padnavigator PUBLIC
Qt::OpenGL
+ Qt::OpenGLWidgets
)
endif()
diff --git a/examples/widgets/graphicsview/padnavigator/CMakeLists.txt b/examples/widgets/graphicsview/padnavigator/CMakeLists.txt
index 7231066b72..a84d3f08d1 100644
--- a/examples/widgets/graphicsview/padnavigator/CMakeLists.txt
+++ b/examples/widgets/graphicsview/padnavigator/CMakeLists.txt
@@ -54,6 +54,7 @@ qt6_add_resources(padnavigator "padnavigator"
if(TARGET Qt::OpenGL)
target_link_libraries(padnavigator PUBLIC
Qt::OpenGL
+ Qt::OpenGLWidgets
)
endif()
diff --git a/examples/widgets/graphicsview/padnavigator/padnavigator.pro b/examples/widgets/graphicsview/padnavigator/padnavigator.pro
index 53a57c85d7..d957be4593 100644
--- a/examples/widgets/graphicsview/padnavigator/padnavigator.pro
+++ b/examples/widgets/graphicsview/padnavigator/padnavigator.pro
@@ -18,7 +18,7 @@ FORMS += \
QT += widgets
requires(qtConfig(treewidget))
-qtHaveModule(opengl): QT += opengl
+qtHaveModule(opengl): QT += opengl openglwidgets
# install
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/graphicsview/padnavigator
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ea62fa8b34..ce94330a90 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -41,6 +41,9 @@ if(QT_FEATURE_gui)
if(QT_FEATURE_widgets)
add_subdirectory(widgets)
+ if(QT_FEATURE_opengl)
+ add_subdirectory(openglwidgets)
+ endif()
endif()
add_subdirectory(platformsupport)
add_subdirectory(platformheaders)
diff --git a/src/opengl/CMakeLists.txt b/src/opengl/CMakeLists.txt
index 6fa346ff89..5ddb50b664 100644
--- a/src/opengl/CMakeLists.txt
+++ b/src/opengl/CMakeLists.txt
@@ -42,17 +42,6 @@ qt_add_module(OpenGL
## Scopes:
#####################################################################
-qt_extend_target(OpenGL CONDITION QT_FEATURE_widgets
- SOURCES
- qopenglwidget.cpp qopenglwidget.h
- LIBRARIES
- Qt::WidgetsPrivate
- PUBLIC_LIBRARIES
- Qt::Widgets
- PRIVATE_MODULE_INTERFACE
- Qt::WidgetsPrivate
-)
-
qt_extend_target(OpenGL CONDITION NOT QT_FEATURE_opengles2
SOURCES
qopenglqueryhelper_p.h
diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro
index f7224da13b..ef81f3aec9 100644
--- a/src/opengl/opengl.pro
+++ b/src/opengl/opengl.pro
@@ -1,6 +1,5 @@
TARGET = QtOpenGL
QT = core-private gui-private
-qtConfig(widgets): QT += widgets widgets-private
DEFINES += QT_NO_USING_NAMESPACE QT_NO_FOREACH
@@ -59,9 +58,4 @@ SOURCES += \
SOURCES += qopengltimerquery.cpp
}
-qtConfig(widgets) {
- HEADERS += qopenglwidget.h
- SOURCES += qopenglwidget.cpp
-}
-
load(qt_module)
diff --git a/src/openglwidgets/CMakeLists.txt b/src/openglwidgets/CMakeLists.txt
new file mode 100644
index 0000000000..d58944e596
--- /dev/null
+++ b/src/openglwidgets/CMakeLists.txt
@@ -0,0 +1,19 @@
+# Generated from openglwidgets.pro.
+
+#####################################################################
+## OpenGLWidgets Module:
+#####################################################################
+
+qt_add_module(OpenGLWidgets
+ SOURCES
+ qopenglwidget.cpp qopenglwidget.h
+ DEFINES
+ QT_NO_FOREACH
+ QT_NO_USING_NAMESPACE
+ LIBRARIES
+ Qt::OpenGLPrivate
+ Qt::WidgetsPrivate
+ PUBLIC_LIBRARIES
+ Qt::OpenGL
+ Qt::Widgets
+)
diff --git a/src/openglwidgets/openglwidgets.pro b/src/openglwidgets/openglwidgets.pro
new file mode 100644
index 0000000000..a058b77ea7
--- /dev/null
+++ b/src/openglwidgets/openglwidgets.pro
@@ -0,0 +1,13 @@
+TARGET = QtOpenGLWidgets
+QT = opengl widgets
+QT_PRIVATE += opengl-private widgets-private
+
+DEFINES += QT_NO_USING_NAMESPACE QT_NO_FOREACH
+
+HEADERS += \
+ qopenglwidget.h
+
+SOURCES += \
+ qopenglwidget.cpp
+
+load(qt_module)
diff --git a/src/opengl/qopenglwidget.cpp b/src/openglwidgets/qopenglwidget.cpp
index cf22a5e2df..aaf009eb87 100644
--- a/src/opengl/qopenglwidget.cpp
+++ b/src/openglwidgets/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 QtOpenGL module of the Qt Toolkit.
+** This file is part of the QtOpenGLWidgets module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QOpenGLWidget
- \inmodule QtOpenGL
+ \inmodule QtOpenGLWidgets
\since 5.4
\brief The QOpenGLWidget class is a widget for rendering OpenGL graphics.
diff --git a/src/opengl/qopenglwidget.h b/src/openglwidgets/qopenglwidget.h
index b266dc359d..0f2884f827 100644
--- a/src/opengl/qopenglwidget.h
+++ b/src/openglwidgets/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 QtOpenGL module of the Qt Toolkit.
+** This file is part of the QtOpenGLWidgets module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -40,9 +40,7 @@
#ifndef QOPENGLWIDGET_H
#define QOPENGLWIDGET_H
-#include <QtOpenGL/qtopenglglobal.h>
-
-#ifdef QT_WIDGETS_LIB
+#include <QtOpenGLWidgets/qtopenglwidgetsglobal.h>
#include <QtWidgets/QWidget>
#include <QtGui/QSurfaceFormat>
@@ -52,7 +50,7 @@ QT_BEGIN_NAMESPACE
class QOpenGLWidgetPrivate;
-class Q_OPENGL_EXPORT QOpenGLWidget : public QWidget
+class Q_OPENGLWIDGETS_EXPORT QOpenGLWidget : public QWidget
{
Q_OBJECT
Q_DECLARE_PRIVATE(QOpenGLWidget)
@@ -110,6 +108,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_WIDGETS_LIB
-
#endif // QOPENGLWIDGET_H
diff --git a/src/openglwidgets/qtopenglwidgetsglobal.h b/src/openglwidgets/qtopenglwidgetsglobal.h
new file mode 100644
index 0000000000..41c73fafda
--- /dev/null
+++ b/src/openglwidgets/qtopenglwidgetsglobal.h
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtOpenGLWidgets module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QTOPENGLWIDGETSGLOBAL_H
+#define QTOPENGLWIDGETSGLOBAL_H
+
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_NAMESPACE
+
+#ifndef QT_STATIC
+# if defined(QT_BUILD_OPENGLWIDGETS_LIB)
+# define Q_OPENGLWIDGETS_EXPORT Q_DECL_EXPORT
+# else
+# define Q_OPENGLWIDGETS_EXPORT Q_DECL_IMPORT
+# endif
+#else
+# define Q_OPENGLWIDGETS_EXPORT
+#endif
+
+QT_END_NAMESPACE
+
+#endif // QTOPENGLWIDGETSGLOBAL_H
diff --git a/src/src.pro b/src/src.pro
index 3445ca0fab..3dc92e7811 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -136,6 +136,10 @@ src_opengl.subdir = $$PWD/opengl
src_opengl.target = sub-opengl
src_opengl.depends = src_gui
+src_openglwidgets.subdir = $$PWD/openglwidgets
+src_openglwidgets.target = sub-openglwidgets
+src_openglwidgets.depends = src_opengl src_widgets
+
src_openglextensions.subdir = $$PWD/openglextensions
src_openglextensions.target = sub-openglextensions
src_openglextensions.depends = src_gui
@@ -230,11 +234,13 @@ qtConfig(gui) {
TOOLS += src_tools_uic
src_plugins.depends += src_widgets
src_testlib.depends += src_widgets # if QtWidgets is enabled, QtTest requires QtWidgets's headers
- src_opengl.depends += src_widgets
qtConfig(printer) {
SUBDIRS += src_printsupport
src_plugins.depends += src_printsupport
}
+ qtConfig(opengl) {
+ SUBDIRS += src_openglwidgets
+ }
}
}
SUBDIRS += src_plugins
diff --git a/sync.profile b/sync.profile
index 6371530814..1a567c3059 100644
--- a/sync.profile
+++ b/sync.profile
@@ -3,6 +3,7 @@
"QtWidgets" => "$basedir/src/widgets",
"QtPrintSupport" => "$basedir/src/printsupport",
"QtOpenGL" => "$basedir/src/opengl",
+ "QtOpenGLWidgets" => "$basedir/src/openglwidgets",
"QtCore" => "$basedir/src/corelib",
"QtXml" => "$basedir/src/xml",
"QtSql" => "$basedir/src/sql",
diff --git a/tests/auto/widgets/graphicsview/CMakeLists.txt b/tests/auto/widgets/graphicsview/CMakeLists.txt
index 5d6650db4a..1f638bd806 100644
--- a/tests/auto/widgets/graphicsview/CMakeLists.txt
+++ b/tests/auto/widgets/graphicsview/CMakeLists.txt
@@ -1,4 +1,6 @@
-if (QT_FEATURE_private_tests)
+# Generated from graphicsview.pro.
+
+if(QT_FEATURE_private_tests)
add_subdirectory(qgraphicsanchorlayout)
add_subdirectory(qgraphicsanchorlayout1)
add_subdirectory(qgraphicsitem)
@@ -15,11 +17,10 @@ add_subdirectory(qgraphicsobject)
add_subdirectory(qgraphicspixmapitem)
add_subdirectory(qgraphicspolygonitem)
add_subdirectory(qgraphicstransform)
-if (NOT WINRT)
- add_subdirectory(qgraphicsview)
-endif()
-
if(QT_FEATURE_style_fusion)
add_subdirectory(qgraphicsproxywidget)
add_subdirectory(qgraphicswidget)
endif()
+if(NOT WINRT)
+ add_subdirectory(qgraphicsview)
+endif()
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicsview/CMakeLists.txt
index 17c9571d62..48064c2bf4 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/CMakeLists.txt
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/CMakeLists.txt
@@ -28,4 +28,5 @@ add_qt_test(tst_qgraphicsview
extend_target(tst_qgraphicsview CONDITION QT_FEATURE_opengl
PUBLIC_LIBRARIES
Qt::OpenGL
+ Qt::OpenGLWidgets
)
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro b/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro
index e95cdcf7d8..13998d5494 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro
@@ -4,7 +4,7 @@ TARGET = tst_qgraphicsview
QT += widgets widgets-private testlib
QT += core-private gui-private testlib-private
-qtConfig(opengl): QT += opengl
+qtConfig(opengl): QT += opengl openglwidgets
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 bd027f9eb1..98833776cc 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
@@ -49,7 +49,7 @@
#include <QtWidgets/QStyle>
#include <QtWidgets/QPushButton>
#if QT_CONFIG(opengl)
-#include <QtOpenGL/QOpenGLWidget>
+#include <QtOpenGLWidgets/QOpenGLWidget>
#endif
#include <private/qgraphicsscene_p.h>
#include <private/qgraphicsview_p.h>
diff --git a/tests/auto/widgets/widgets/qopenglwidget/CMakeLists.txt b/tests/auto/widgets/widgets/qopenglwidget/CMakeLists.txt
index d9e447d38b..c3fdf39fe1 100644
--- a/tests/auto/widgets/widgets/qopenglwidget/CMakeLists.txt
+++ b/tests/auto/widgets/widgets/qopenglwidget/CMakeLists.txt
@@ -13,5 +13,6 @@ add_qt_test(tst_qopenglwidget
Qt::GuiPrivate
Qt::OpenGL
Qt::OpenGLPrivate
+ Qt::OpenGLWidgets
Qt::Widgets
)
diff --git a/tests/auto/widgets/widgets/qopenglwidget/qopenglwidget.pro b/tests/auto/widgets/widgets/qopenglwidget/qopenglwidget.pro
index f78dc510bf..792bbf4529 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 += opengl opengl-private gui-private core-private testlib widgets
+QT += opengl opengl-private gui-private core-private testlib widgets openglwidgets
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 e96e292525..73423d958b 100644
--- a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
+++ b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
@@ -26,7 +26,7 @@
**
****************************************************************************/
-#include <QtOpenGL/QOpenGLWidget>
+#include <QtOpenGLWidgets/QOpenGLWidget>
#include <QtGui/QOpenGLFunctions>
#include <QtGui/QPainter>
#include <QtGui/QScreen>
diff --git a/util/cmake/helper.py b/util/cmake/helper.py
index 142ca55c6b..6bd54b5534 100644
--- a/util/cmake/helper.py
+++ b/util/cmake/helper.py
@@ -213,6 +213,7 @@ _qt_library_map = [
"openglextensions", "Qt6", "Qt::OpenGLExtensions", extra=["COMPONENTS", "OpenGLExtensions"]
),
LibraryMapping("opengl", "Qt6", "Qt::OpenGL", extra=["COMPONENTS", "OpenGL"]),
+ LibraryMapping("openglwidgets", "Qt6", "Qt::OpenGLWidgets", extra=["COMPONENTS", "OpenGLWidgets"]),
LibraryMapping(
"package-lib", "Qt6", "Qt::AppManPackage", extra=["COMPONENTS", "AppManPackage"]
),