Error cmake: QGLWidget: no such file or directory

I am trying to use cmake with Qt, but when creating, I get the following error.

QGLWidget: No such file or directory

In my CMakeLists.txt file, I have:

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
find_package(Qt5Widgets)
qt5_use_modules(SHWidget Widgets)
+4
source share
1 answer

As noted in the QtOpenGL docs module :

A warning. Besides the QGLWidget class, this module should no longer be used for new code.

In other words, you need to add an expansion module QtOpenGLto your assembly.

+2
source

All Articles