Doesn't passing QGLWidget as parent take care of that? I haven't tried that, but since QGLWidget is derived from QWidget and you can paint on QGLWidget using regular QPainter, maybe it'll work?