diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-07-13 06:12:26 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-07-13 06:12:26 (GMT) |
commit | 181749ff7dcfbeb5eb64026e80353f27013af833 (patch) | |
tree | 901db29f7336508826917f5b0bbce73808a729f2 | |
parent | 5efd577b1aea64f422e08ca8d54e041fa4b20783 (diff) | |
download | Qt-181749ff7dcfbeb5eb64026e80353f27013af833.zip Qt-181749ff7dcfbeb5eb64026e80353f27013af833.tar.gz Qt-181749ff7dcfbeb5eb64026e80353f27013af833.tar.bz2 |
Ensure the section header isn't shown twice.
Happened when currentItem was on a section boundary.
Task-number: QTBUG-12089
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativelistview.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 91e9995..cd26472 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -494,7 +494,7 @@ public: QSmoothedAnimation *highlightSizeAnimator; QDeclarativeViewSection *sectionCriteria; QString currentSection; - static const int sectionCacheSize = 3; + static const int sectionCacheSize = 4; QDeclarativeItem *sectionCache[sectionCacheSize]; qreal spacing; qreal highlightMoveSpeed; @@ -1029,6 +1029,11 @@ void QDeclarativeListViewPrivate::updateCurrent(int modelIndex) } currentItem->item->setFocus(true); currentItem->attached->setIsCurrentItem(true); + // Avoid showing section delegate twice. We still need the section heading so that + // currentItem positioning works correctly. + // This is slightly sub-optimal, but section heading caching minimizes the impact. + if (currentItem->section) + currentItem->section->setVisible(false); } updateHighlight(); emit q->currentIndexChanged(); |