Minimal [QGLWidget + ui] code

  • Hello Fellas, i started learning OpenGL2 recently and trying to understand how to implement it inside a Qt project, i know there are many tutorials and examples out there, but i didn't manage to find the minimal requirments (some kind of a "(0,0) dot" for an opengl in Qt) including both QWidget and QGLWdget (inside the previous).

    i ask for the shortest example for a code to implement that QGLWidget (empty, no need for geometry) to fit inside a .ui form, for Qt5. The simpler the better to understand. thanks in advance and cheers.

    (Linux btw)

  • Moderators


    I recommend using "QOpenGLWidget": from Qt 5.4. QGLWidget is now deprecated.

    See the "beginners' tutorial": for creating a widget project. Jump down to "Using Qt Designer", and replace the "Text Edit" with "OpenGL Widget".

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.