Converting QWidget to QGLWidget in Qt Creator
-
(see title) I'm a newcomer to Qt and have read some tutorials online about using OpenGL with Qt. I found one that I cannot seem to find that renders to an openGl framebuffer that is then rendered to (what starts as) a QWidget. There was some step in making the QWidget a QGLWidget but I remember that it used the GUI designer to get the layout right etc... How does one go about doing this? Thanks!
-
I think you want the promotion feature in Designer:
http://qt-project.org/doc/qt-5/designer-using-custom-widgets.html- Drop a QWidget on your form
- Right click it and select "Promote to..."
** Base class name : QWidget
** Promoted class name: QGLWidget
** Header file: QGLWidget
** Global include: checked - Click Add then Promote
-
Yes! This was it, thanks a lot!