Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QT OpenGL QGLWidget cannot be found

Tags:

qt

I am new to Qt and I have problem. I downloaded Qt SDK for Open Source C++ development from http://qt.nokia.com/downloads/sdk-windows-cpp, I add C:\QT\2010.05\bin in my PATH. When I start some demo projects it works, but when I create 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). Do I need to add anything else to my PATH? Does anybody know what could be the problem?

like image 399
Damir Avatar asked Nov 22 '10 13:11

Damir


2 Answers

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

QT += core gui opengl
like image 74
Cory Klein Avatar answered Sep 23 '22 04:09

Cory Klein


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

like image 44
Patrice Bernassola Avatar answered Sep 20 '22 04:09

Patrice Bernassola