Search code examples
c++qtopenglqt4qt4.6

How to Integrate OpenGL and Qt?


I'm working on a small project and I need to use OpenGL and Qt.

I'm a newbie with both libraries, so I need a good tutorial that illustrates how to use both of them together.

Is it better to work with OpenGL in Qt Creator or to use the Qt Visual Studio Plug-in?


Solution

  • You'll be using QGLWidget a lot! Here you go:

    http://doc.qt.io/qt-5/examples-widgets-opengl.html

    Of all those, maybe this is the best one to start: Hello GL Example. If you prefer using Qt Quick instead of Qt Widgets, check these posts:

    If you want a higher-level 3D API than OpenGL, as o Qt 5.7 Qt 3D became stable.

    As for the IDE I suggest using Qt Creator. It works out of the box on Windows and the syntax highlighting and autocomplete are comparable to Visual Studio.