[Qt-interest] qgraphicsview and opengl

Yifei Li yifli at mtu.edu
Fri Oct 30 02:07:32 CET 2009


Hi,

I was using QGLWidget to display some opengl stuff. Now I want to switch to QGraphicsView because I need to put some QWidget on top of the opengl rendering window. I know I need to move all the stuff inside QGLWidget::paintGL() into QGraphicsScene::drawBackground(), but what about QGLWidget::initializeGL()?  Where is the appropriate place to call the stuff inside initializeGL()?


I found from http://websvn.kde.org/trunk/playground/libs/kgllib/extras/kgllib/widgetproxy.h?view=log a class called WidgetProxy, which allows users to use an existing custom QGLWidget class. I tried that with my own QGLWidget class. However, even though initializeGL() and paintGL() get called, nothing is displayed. Has anyone managed to get WidgetProxy work?


Yifei 



More information about the Qt-interest-old mailing list