Skip to content

Commit 30b2ede

Browse files
committed
Force dependency on Qt OpenGL Widgets on Windows
1 parent 7499f16 commit 30b2ede

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
77

88
option(SCRATCHCPP_PLAYER_BUILD_UNIT_TESTS "Build unit tests" ON)
99

10-
find_package(Qt6 6.6 COMPONENTS Quick QuickControls2 Widgets REQUIRED)
11-
set(QT_LIBS Qt6::Quick Qt6::QuickControls2 Qt6::Widgets)
10+
find_package(Qt6 6.6 COMPONENTS Quick QuickControls2 Widgets OpenGLWidgets REQUIRED)
11+
set(QT_LIBS Qt6::Quick Qt6::QuickControls2 Qt6::Widgets Qt6::OpenGLWidgets)
1212

1313
if (SCRATCHCPP_PLAYER_BUILD_UNIT_TESTS)
1414
set(GTEST_DIR thirdparty/googletest)

src/app/app.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
#include "modularity/ioc.h"
1313
#include "ui/internal/uiengine.h"
1414

15+
#ifdef Q_OS_WINDOWS
16+
#include <QOpenGLWidget>
17+
#endif
18+
1519
using namespace scratchcpp;
1620
using namespace scratchcpp::modularity;
1721

@@ -82,6 +86,10 @@ int App::run(int argc, char **argv)
8286

8387
ui::UiEngine::instance()->setQmlEngine(&engine);
8488

89+
#ifdef Q_OS_WINDOWS
90+
QOpenGLWidget glWidget; // force dependency on OpenGL widgets
91+
#endif
92+
8593
// Run the event loop
8694
int exitCode = app.exec();
8795

0 commit comments

Comments
 (0)