-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.3.2
-
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