diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-03-04 05:29:43 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-03-04 05:29:43 (GMT) |
commit | 84709f178dde24d4926f0222b6ce0ab692eeba67 (patch) | |
tree | 86ff0a78395147d0b5515c7d66a373f8600d0ee8 | |
parent | 8047d8f2e63df60b5ea3f6fd02568658c3d19fc6 (diff) | |
download | Qt-84709f178dde24d4926f0222b6ce0ab692eeba67.zip Qt-84709f178dde24d4926f0222b6ce0ab692eeba67.tar.gz Qt-84709f178dde24d4926f0222b6ce0ab692eeba67.tar.bz2 |
Fix ListView contentHeight calculation.
Task-number: QT-2630
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativelistview.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 32627da..18d3661 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -223,7 +223,7 @@ public: if (!visibleItems.isEmpty()) { pos = (*visibleItems.constBegin())->position(); if (visibleIndex > 0) - pos -= visibleIndex * (averageSize + spacing) - spacing; + pos -= visibleIndex * (averageSize + spacing); } return pos; } @@ -2414,7 +2414,8 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count) int i = d->visibleItems.count() - 1; while (i > 0 && d->visibleItems.at(i)->index == -1) --i; - if (d->visibleItems.at(i)->index + 1 == modelIndex) { + if (d->visibleItems.at(i)->index + 1 == modelIndex + && d->visibleItems.at(i)->endPosition() < d->buffer+d->position()+d->size()-1) { // Special case of appending an item to the model. modelIndex = d->visibleIndex + d->visibleItems.count(); } else { |