I wanted to try to inherit a Qt widget from QOpenGLWidget
instead of QWidget
. To do this, I:
- Replaced
class MyWidget : public QWidget
byclass MyWidget : public QOpenGLWidget
. - Added
#include <QOpenGLWidget>
. - Changed CMakeLists.txt by adding
OpenGLWidgets
tofind_package
and addingQt6::OpenGLWidgets
totarget_link_libraries
. - Ensured
libqt6opengl6-dev
is installed.
When running make
, the following error is displayed:
Visualization.h:10:10: fatal error: QOpenGLWidget: No such file or directory
10 | #include <QOpenGLWidget>
| ^~~~~~~~~~~~~~~
compilation terminated.
What else do I need to do to make QOpenGLWidget available?