The QGLWidget is set as the viewport, it's not a widget added using the addWidget method:
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
int main(int argc, char **argv)
{
QApplication app(argc, argv);
QGraphicsView view;
view.setViewport(new CustomGLWidget());
view.setViewportUpdateMode(QGraphicsView::NoViewportUpdate); // tried different options
QGraphicsScene *s = new QGraphicsScene();
myWidget *w = new myWidget(); // it's a class based on QWidget that paints something
s->addWidget(w); // it could be any ohter QWidget
view.setScene(s);
view.resize(800, 600);
view.show();
return app.exec();
}
|
If I paint something in the paintGL() event of the CustomGLWidget() I have the behavior described above.
What I'm trying to do is very simple: draw in the CustomGLWidget() because it's fast and have a standard QPainter on its top to draw an overlay.