Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-1733

When QGraphicsView has a QGLWidget as its viewport, the background is not updated correctly when there is no scene

    XMLWordPrintable

Details

    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).

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            bjnilsen Bjørn Erik Nilsen
            anshaw Andy Shaw (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes