on xenial help sign in
Only update the "section" if we are not culling the item
d8e5d9aAlbert Astals
plugins/ListViewWithPageHeader/listviewwithpageheader.cpp+5−5
@@ -1037,11 +1037,6 @@ void ListViewWithPageHeader::layout()
1037 if (!cull && firstReallyVisibleItem == -1) {
1037 if (!cull && firstReallyVisibleItem == -1) {
1038 firstReallyVisibleItem = modelIndex;
1038 firstReallyVisibleItem = modelIndex;
1039 if (m_topSectionItem) {
1039 if (m_topSectionItem) {
1040− // Update the top sticky section header
1041− const QString section = m_delegateModel->stringValue(modelIndex, m_sectionProperty);
1042− QQmlContext *context = QQmlEngine::contextForObject(m_topSectionItem)->parentContext();
1043− context->setContextProperty(QLatin1String("section"), section);
1044−
1045 // Positing the top section sticky item is a two step process
1040 // Positing the top section sticky item is a two step process
1046 // First we set it either we cull it (because it doesn't need to be sticked to the top)
1041 // First we set it either we cull it (because it doesn't need to be sticked to the top)
1047 // or stick it to the top
1042 // or stick it to the top
@@ -1058,6 +1053,11 @@ void ListViewWithPageHeader::layout()
1058 QQuickItemPrivate::get(item->m_sectionItem)->setCulled(false);
1053 QQuickItemPrivate::get(item->m_sectionItem)->setCulled(false);
1059 }
1054 }
1060 } else {
1055 } else {
1056+ // Update the top sticky section header
1057+ const QString section = m_delegateModel->stringValue(modelIndex, m_sectionProperty);
1058+ QQmlContext *context = QQmlEngine::contextForObject(m_topSectionItem)->parentContext();
1059+ context->setContextProperty(QLatin1String("section"), section);
1060+
1061 QQuickItemPrivate::get(m_topSectionItem)->setCulled(false);
1061 QQuickItemPrivate::get(m_topSectionItem)->setCulled(false);
1062 m_topSectionItem->setY(topSectionStickPos);
1062 m_topSectionItem->setY(topSectionStickPos);
1063 if (item->m_sectionItem) {
1063 if (item->m_sectionItem) {