Check pending changes before they are reset, not after
authorBea Lam <bea.lam@nokia.com>
Thu, 16 Feb 2012 04:52:39 +0000 (14:52 +1000)
committerQt by Nokia <qt-info@nokia.com>
Fri, 17 Feb 2012 03:28:41 +0000 (04:28 +0100)
Change-Id: Ibe295741ee323522b98e4fd834f61053f9053e1f
Reviewed-by: Martin Jones
Reviewed-by: Martin Jones <martin.jones@nokia.com>

src/quick/items/qquickitemview.cpp

index 87a428a..eee1504 100644 (file)
@@ -2455,14 +2455,14 @@ bool QQuickItemViewPrivate::applyModelChanges(ChangeResult *totalInsertionResult
         if (!currentIndexCleared)
             updateCurrent(currentChanges.newCurrentIndex);
     }
+
+    if (!visibleAffected)
+        visibleAffected = !currentChanges.pendingChanges.changes().isEmpty();
     currentChanges.reset();
 
     updateSections();
     if (prevItemCount != itemCount)
         emit q->countChanged();
-
-    if (!visibleAffected)
-        visibleAffected = !currentChanges.pendingChanges.changes().isEmpty();
     if (!visibleAffected && viewportChanged)
         updateViewport();