Where is QOpenGLWidget?
Solved
General and Desktop
-
I'm trying to write a C++ application that uses QOpenGLWidget, but qtcreator gives "'QOpenGLWidget' file not found" error on this line:
#include <QOpenGLWidget>
Documentation says QOpenGLWidget was introduced in Qt 5.4, and I believe I am running Qt 5.12; 'qmake --version' gives:
QMake version 3.1
Using Qt version 5.12.1 in /home/oreilly/Qt5.12.1/5.12.1/gcc_64/libWhat am I doing wrong?
Thanks
Tom -
Where is QOpenGLWidget?
It is in the Qt Widgets module. So if
#include <QWidget>
works, then#include <QOpenGLWidget>
should also work.Make sure your .pro file is set to use the Qt Widgets module (something like
QT += widgets
)