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

QWidgets Leaving Artifacts of Previous Paints

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 5.3.2
    • GUI: Painting
    • None
    • Windows 8.1, Linux

      I have an application that interactively moves objects derived from QWidget around the screen. Sometimes, they leave artifacts of the previous geometries which get cleaned up when I switch focus to another application, but stay on the screen until then.

      Here is the paintEvent function:

      void TestWidget::paintEvent(QPaintEvent *e)
      {
          QBrush b(QColor(55,200,55,190));
          QPainter p(this);
          p.setBrush(b);
          //p.drawRect(QRect(QPoint,this->geometry().size()));
          //p.drawRect(QRect(QPoint,geometry().size()));
          if(thisRect().width() != 0 && thisRect().height() != 0)
          {
              p.drawRect(thisRect());
              qDebug() << "painted rect is " << thisRect();
              qDebug() << "painted geo  is " << geometry();
          }
      }
      

      There is a test case, pictures, and further discussion here:

      http://stackoverflow.com/questions/27058165/qwidgets-leaving-artifacts-of-previous-paint

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

            sletta Gunnar Sletta
            markanth Mark
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes