Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix transition when removing the last item from ListView/GridView
Use the previous item view boundaries (before a remove was applied)
when defining transition properties.

Task-number: QTBUG-64311
Change-Id: I66870a7267ac26ea430c364383f32fd5c47d4a5d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
  • Loading branch information
karihautamaki authored and ec1oud committed Feb 2, 2018
1 parent 4b014ef commit 23ea4cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/quick/items/qquickitemview.cpp
Expand Up @@ -1894,6 +1894,9 @@ void QQuickItemViewPrivate::layout()

inLayout = true;

// viewBounds contains bounds before any add/remove/move operation to the view
QRectF viewBounds(q->contentX(), q->contentY(), q->width(), q->height());

if (!isValid() && !visibleItems.count()) {
clear();
setPosition(contentStartOffset());
Expand Down Expand Up @@ -1960,7 +1963,6 @@ void QQuickItemViewPrivate::layout()

prepareVisibleItemTransitions();

QRectF viewBounds(q->contentX(), q->contentY(), q->width(), q->height());
for (QList<FxViewItem*>::Iterator it = releasePendingTransition.begin();
it != releasePendingTransition.end(); ) {
FxViewItem *item = *it;
Expand Down

0 comments on commit 23ea4cf

Please sign in to comment.