diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-11-24 01:25:07 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-11-24 01:32:12 (GMT) |
commit | d32360bb33e830f8c17a6db1a31f529436c2915e (patch) | |
tree | 1cab53106f9fb075c814248c5a588af237c2716f /src | |
parent | 5d0be38c15acf28969bd8bf984ab23a29fa8e354 (diff) | |
download | Qt-d32360bb33e830f8c17a6db1a31f529436c2915e.zip Qt-d32360bb33e830f8c17a6db1a31f529436c2915e.tar.gz Qt-d32360bb33e830f8c17a6db1a31f529436c2915e.tar.bz2 |
Avoid lockup in ListView when animating delegates.
Animating delegates results in the content height changing, which
may result in fixup being called if at the ends of the view, which
may in turn cause refill to be called, which will change the content
height, which repeats. Prevent this recusion from happening.
Task-number: QTBUG-14821
Reviewed-by: Bea Lam
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativelistview.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 6be49ba..450b6af 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -183,6 +183,7 @@ public: , ownModel(false), wrap(false), autoHighlight(true), haveHighlightRange(false) , correctFlick(false), inFlickCorrection(false), lazyRelease(false) , deferredRelease(false), layoutScheduled(false), currentIndexCleared(false) + , inViewportMoved(false) , minExtentDirty(true), maxExtentDirty(true) {} @@ -503,6 +504,7 @@ public: bool deferredRelease : 1; bool layoutScheduled : 1; bool currentIndexCleared : 1; + bool inViewportMoved : 1; mutable bool minExtentDirty : 1; mutable bool maxExtentDirty : 1; }; @@ -2281,6 +2283,10 @@ void QDeclarativeListView::viewportMoved() QDeclarativeFlickable::viewportMoved(); if (!d->itemCount) return; + // Recursion can occur due to refill changing the content size. + if (d->inViewportMoved) + return; + d->inViewportMoved = true; d->lazyRelease = true; refill(); if (d->flickingHorizontally || d->flickingVertically || d->movingHorizontally || d->movingVertically) @@ -2294,6 +2300,7 @@ void QDeclarativeListView::viewportMoved() pos = viewPos + d->highlightRangeEnd - d->highlight->size(); if (pos < viewPos + d->highlightRangeStart) pos = viewPos + d->highlightRangeStart; + d->highlightPosAnimator->stop(); d->highlight->setPosition(qRound(pos)); // update current index @@ -2341,6 +2348,7 @@ void QDeclarativeListView::viewportMoved() } d->inFlickCorrection = false; } + d->inViewportMoved = false; } qreal QDeclarativeListView::minYExtent() const |