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

QGraphicsView::setCacheMode(CacheBackground) refresh problem

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 4.6.2
    • 4.5.3
    • Widgets: GraphicsView
    • None

    Description

      The problem can be summarised as a lack of repaint on a window that is first partly hidden, minimised and then restored.

      The code below reproduces is on Qt 4.5.2:-

      #include <QtGui>

      int main(int argc, char *argv[])
      {
      QApplication app(argc, argv);

      QMainWindow mainWin;
      QMdiArea *mdiArea = new QMdiArea;
      mainWin.setCentralWidget(mdiArea);
      mainWin.show();

      QGraphicsView *view = new QGraphicsView;
      view->setCacheMode(QGraphicsView::CacheBackground);
      QBrush brush(QLinearGradient(0,0,256,256));
      brush.setColor(Qt::blue);
      view->setBackgroundBrush(brush);

      QGraphicsScene *scene = new QGraphicsScene;
      scene->addRect(QRectF(10,10,30,40),QPen(QColor(Qt::yellow)),QBrush(QColor(Qt::red)));
      scene->setSceneRect(QRectF(0.0, 0.0, 256, 256));

      view->setScene(scene);

      mdiArea->addSubWindow(view);

      view->show();

      return app.exec();
      }

      To reproduce the problem do the following:

      • move the small SubWindow to the left, so that half of the window is hidden
      • iconify the window
      • restore the window
      • move the window to the right, so that the previous hidden part is visible again
        only half of the window background is restored correctly.

      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
            cattell Matthew Cattell (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes