Hi,

I am interested to be able to draw the regular Qt widgets (like QPushButton) in an OpenGL context.
Note, I am NOT interested in having a QPushButton on top of a QGLWidget (where the glwidget is the parent of the button) but rather, to pass an openGL initialized QPainter to the QPushButton and let it draw it self as usual, but since the QPainter is an openGL context painter, the button should then draw it self in the openGL context.
In principal, this is very much like this example: http://doc.trolltech.com/4.1/opengl-2dpainting.html
Only, in this example, the drawing is a custom drawing, so the widget draws it self with the openGL initialized QPainter.
The problem is, I couldn't yet find a way to pass an externally initialized painter to a QWidget...
I thought as well about implementing a QPaintEngine.
However, there are server disadvantages to this approach:
1. I want to use openGL rendering, and the trolls already implemented a paint engine for openGL - accessible through QGLWidget. - so no need to reimplement such an engine.
2. A new paint engine means a new kind of widget to have all the other widgets drive from (i.e a new QWidget) (because the PaintDevice is a new implementation) - which is why there is a QGLWdiget...
This is a problem since it means I will have to derive each Qt widget that I want to draw in openGL from that class...

So is there a way to pass an openGL initialized painter to a QWidget?

Or do you have other comments that could help me in this regard?

Thanks.