I'm experimenting with using Qt as the GUI back-end for a 3D game but during my experiments with QGLWidget I've ran into some issues that hopefully some of you can help resolve or offer better implementation ideas.
Approach 1: Create a QGLWidget, and use it as the parent of regular QWidgets, let Qt manage drawing.
This seems to achieve the general idea of using QWidgets as an overlay for a GL window however I am unsure on the correct method for drawing. For the game loop I would ideally update the GL window via timer using updateGL() and have the widgets draw afterward (with transparency). So far I have been able to draw opaque widgets but I have been unable to make a widget draw with either background brush transparency or full transparency (I'm probably doing it wrong). Another concern is the speed of drawing the Widgets ontop as I am unaware of the internals going on with Qt and GL (is it using an internal overlay?)
Approach 2: Create QGLWindow, Widgets(hidden), draw widgets to dynamicTextures.
Another idea I had was to create a Widget and draw to a dynamic texture applied to a GL surface. This could be done using by changing the widget paintEvent or using grabWidget somewhere. The mouse events in the GLWidget would need translated and redirected to the corresponding Widgets depicted by the textured GL surface. This probably doesn't solve the transparency issue either, however making rects in GL transparent is easy, but not the best way as I may not want QLabel text to be transparent, just the background.
If there is some way I could put a Widget in a GLWidget, tell it not to draw (instead draw to the dynamicTexture), but still handle mouse clicks for the area it *would* draw to, then that would just be peachy

Approach 1 is the simplest but Approach 2 is most likely way faster.
Any help/ideas would be appreciated.
Bookmarks