@@ -199,6 +199,7 @@ void ListViewWithPageHeader::setModel(QAbstractItemModel *model)
199 connect(m_delegateModel, SIGNAL(modelUpdated(QQmlChangeSet,bool)), this, SLOT(onModelUpdated(QQmlChangeSet,bool)));
199 connect(m_delegateModel, SIGNAL(modelUpdated(QQmlChangeSet,bool)), this, SLOT(onModelUpdated(QQmlChangeSet,bool)));
201 Q_EMIT modelChanged();
201 Q_EMIT modelChanged();
203// Q_EMIT contentHeightChanged();
204// Q_EMIT contentHeightChanged();
204// Q_EMIT contentYChanged();
205// Q_EMIT contentYChanged();
@@ -1006,6 +1007,18 @@ void ListViewWithPageHeader::onModelUpdated(const QQmlChangeSet &changeSet, bool
1010+ Q_FOREACH(const QQuickChangeSet::Change &change, changeSet.changes()) {
1011+// qDebug() << "ListViewWithPageHeader::onModelUpdated Change" << change.index << change.count;
1012+ for (int i = change.index; i < change.count; ++i) {
1013+ ListItem *item = itemAtIndex(i);
1014+ if (item && item->m_sectionItem) {
1015+ QQmlContext *context = QQmlEngine::contextForObject(item->m_sectionItem)->parentContext();
1016+ const QString sectionText = m_delegateModel->stringValue(i, m_sectionProperty);
1017+ context->setContextProperty(QLatin1String("section"), sectionText);
1009 if (m_firstVisibleIndex != oldFirstVisibleIndex) {
1022 if (m_firstVisibleIndex != oldFirstVisibleIndex) {
1010 adjustMinYExtent();
1023 adjustMinYExtent();
@@ -1154,6 +1167,7 @@ void ListViewWithPageHeader::layout()
1154 // Update the top sticky section header
1167 // Update the top sticky section header
1155 const QString section = m_delegateModel->stringValue(modelIndex, m_sectionProperty);
1168 const QString section = m_delegateModel->stringValue(modelIndex, m_sectionProperty);
1156 QQmlContext *context = QQmlEngine::contextForObject(m_topSectionItem)->parentContext();
1169 QQmlContext *context = QQmlEngine::contextForObject(m_topSectionItem)->parentContext();
1170+ qDebug() << modelIndex << section;
1157 context->setContextProperty(QLatin1String("section"), section);
1171 context->setContextProperty(QLatin1String("section"), section);
1159 QQuickItemPrivate::get(m_topSectionItem)->setCulled(false);
1173 QQuickItemPrivate::get(m_topSectionItem)->setCulled(false);