From 651b7aa72052faa90b3a268f00f82d56460166d3 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 3 Aug 2009 09:45:20 +1000 Subject: Items marked for removal should be excluded from section updates. --- src/declarative/fx/qfxlistview.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/declarative/fx/qfxlistview.cpp b/src/declarative/fx/qfxlistview.cpp index f976aec..1e75026 100644 --- a/src/declarative/fx/qfxlistview.cpp +++ b/src/declarative/fx/qfxlistview.cpp @@ -697,9 +697,11 @@ void QFxListViewPrivate::updateSections() if (visibleIndex > 0) prevSection = sectionAt(visibleIndex-1); for (int i = 0; i < visibleItems.count(); ++i) { - QFxListViewAttached *attached = visibleItems.at(i)->attached; - attached->setPrevSection(prevSection); - prevSection = attached->section(); + if (visibleItems.at(i)->index != -1) { + QFxListViewAttached *attached = visibleItems.at(i)->attached; + attached->setPrevSection(prevSection); + prevSection = attached->section(); + } } } } @@ -1528,6 +1530,7 @@ void QFxListView::itemsRemoved(int modelIndex, int count) d->updateCurrent(qMin(modelIndex, d->model->count()-1)); } d->layout(); + d->updateSections(); emit countChanged(); return; } @@ -1590,6 +1593,7 @@ void QFxListView::itemsRemoved(int modelIndex, int count) } else { // Correct the positioning of the items d->layout(); + d->updateSections(); } emit countChanged(); -- cgit v0.12