OpenGL issues in QT5
-
I'm having some difficulty with OpenGL in Qt5 and am not sure I know what I'm doing wrong.
I can run the 5.0 OpenGL examples fine and I can run the NeHe 4.8 OpenGL examples fine http://qt-project.org/wiki/NeHe_in_Qt
When I convert the simple NeHe 4.8 examples to 5.0 though the only thing that works is clearing the screen to black, none of the polygons are rendered.
I found this post which which implies that the OpenGL context works differently in Qt5 http://qt-project.org/forums/viewthread/20033
For reference, my ultimate goal is to use a QDeclarativeView with an QGLWidget for the viewport and a QGraphicsScene for the scene with glut calls in drawBackground(QPainter *painter, const QRectF &rect)
-
My advice is start off simple and just use a QWindow subclass, create yourself a QOpenGLContext to get your own rendering working.
Once that is working, change your window class to inherit from QDeclarativeView and set a QML scene on it and integrate your rendering.
These two videos may be of interest to you ;)
http://www.youtube.com/watch?v=VxsS7u-vgc8&list=PLizsthdRd0YzYe5T3Txgg7TUGVi-ijq4d&index=20
http://www.youtube.com/watch?v=GYa5DLV6ADQ&list=PLizsthdRd0YzYe5T3Txgg7TUGVi-ijq4d&index=21