aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2011-08-03 15:40:58 +1000
committerQt by Nokia <qt-info@nokia.com>2011-08-04 09:31:25 +0200
commitb1b50553cf73795e25337d5e5bb70530c90dd350 (patch)
tree5a4e691400f9ddfacdf7ad5a71472487d014d439 /src
parentc8cb154e167ae82e464b07aed8c5a0aac1112d9e (diff)
Fix ListView refill() where delegate size == 0
When refilling, if a delegate item is positioned at the start of the buffer, it should only be removed if its height is > 0. Otherwise refill() will constantly remove it in removeNonVisibleItems() and add it again in the next frame in addVisibleItems(). Regression from aa99d4f5cb4f1f512d1db90536752b518dbea449 Task-number: QTBUG-20712 Change-Id: I21d25fde21e0b559a378c9e202ace58947417a4d Reviewed-on: http://codereview.qt.nokia.com/2541 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/declarative/items/qsglistview.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/declarative/items/qsglistview.cpp b/src/declarative/items/qsglistview.cpp
index d9792d1770..e1623390f8 100644
--- a/src/declarative/items/qsglistview.cpp
+++ b/src/declarative/items/qsglistview.cpp
@@ -603,6 +603,8 @@ bool QSGListViewPrivate::removeNonVisibleItems(int bufferFrom, int bufferTo)
while (visibleItems.count() > 1 && (item = visibleItems.first()) && item->endPosition() <= bufferFrom) {
if (item->attached->delayRemove())
break;
+ if (item->size() == 0)
+ break;
// qDebug() << "refill: remove first" << visibleIndex << "top end pos" << item->endPosition();
if (item->index != -1)
visibleIndex++;