Details
-
Bug
-
Resolution: Out of scope
-
P2: Important
-
4.3.4
-
None
Description
When QGraphicsView has a QGLWidget as its viewport, the background is not updated correctly when there is no scene, moving a window over it will cause artificats to be left on the view.
The following example demonstrates the problem:
#include <QtGui>
#include <QtOpenGL>
int main(int argc, char **argv)
{
QApplication a(argc, argv);
QGraphicsView gv;
gv.setViewport(new QGLWidget(&gv));
QGraphicsScene *s = new QGraphicsScene(&gv);
s->addRect(0, 0, 50, 50, QPen(Qt::blue), QBrush(Qt::blue));
gv.setScene(s);
gv.setBackgroundBrush(QBrush(Qt::red));
gv.show();
gv.setScene(0);
return a.exec();
}
Update: As a temporary workaround, you can assign an empty scene to the view instead of no scene (0).