Fix losing dirty state when calling update() from paintGL()

When the paint for the QOpenGLWidget was in invoked on the
fast path, where only that widget was dirty, the resetWidget
call after sending the paint event removed the widget from the
dirty list, making it impossible to schedule an update during the
event handling. The correct way is to clean the list and then send
the paint events.

Change-Id: Icdad5686ded7944fd1c8af56496f725e163a60e6
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
bb10
Laszlo Agocs 2014-09-28 18:51:45 +02:00
parent 5d36c74cb6
commit 90ce9701d0
1 changed files with 6 additions and 1 deletions

View File

@ -1135,12 +1135,17 @@ void QWidgetBackingStore::doSync()
// prevent triggering unnecessary backingstore painting when only the
// OpenGL content changes. Check if we have such widgets in the special
// dirty list.
QVarLengthArray<QWidget *, 16> paintPending;
for (int i = 0; i < dirtyRenderToTextureWidgets.count(); ++i) {
QWidget *w = dirtyRenderToTextureWidgets.at(i);
w->d_func()->sendPaintEvent(w->rect());
paintPending << w;
resetWidget(w);
}
dirtyRenderToTextureWidgets.clear();
for (int i = 0; i < paintPending.count(); ++i) {
QWidget *w = paintPending[i];
w->d_func()->sendPaintEvent(w->rect());
}
// We might have newly exposed areas on the screen if this function was
// called from sync(QWidget *, QRegion)), so we have to make sure those