QT OpenGL QGLWidget not found

I am new to QT and I have a problem. I downloaded the Qt SDK for developing Open Source C ++ from http://qt.nokia.com/downloads/sdk-windows-cpp , I add C: \ QT \ 2010.05 \ bin to my PATH. When I start some demo projects, it works, but when I create the same project (I create a new project and copy the source code from the demo), it shows an error like โ€œQGLWidget cannot be foundโ€ (I need to create an OpenGL project). Should I include more things in my WAY? Does anyone know what could be the problem?

+6
qt
source share
2 answers

You need to add the OpenGL module to the project file (.pro) as an explanation in the document: http://doc.qt.io/qt-5/qtopengl-index.html#details

+7
source share

Edit your .pro file and add opengl as a QT option:

 QT += core gui opengl 
+7
source share

All Articles