@@ -199,6 +199,7 @@ void ListViewWithPageHeader::setModel(QAbstractItemModel *model)
199199 connect(m_delegateModel, SIGNAL(modelUpdated(QQmlChangeSet,bool)), this, SLOT(onModelUpdated(QQmlChangeSet,bool)));
200200#endif
201201 Q_EMIT modelChanged();
202+ polish();
202203 // TODO?
203204// Q_EMIT contentHeightChanged();
204205// Q_EMIT contentYChanged();
@@ -1006,6 +1007,18 @@ void ListViewWithPageHeader::onModelUpdated(const QQmlChangeSet &changeSet, bool
10061007 }
10071008 }
10081009
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);
1018+ }
1019+ }
1020+ }
1021+
10091022 if (m_firstVisibleIndex != oldFirstVisibleIndex) {
10101023 adjustMinYExtent();
10111024 }
@@ -1154,6 +1167,7 @@ void ListViewWithPageHeader::layout()
11541167 // Update the top sticky section header
11551168 const QString section = m_delegateModel->stringValue(modelIndex, m_sectionProperty);
11561169 QQmlContext *context = QQmlEngine::contextForObject(m_topSectionItem)->parentContext();
1170+ qDebug() << modelIndex << section;
11571171 context->setContextProperty(QLatin1String("section"), section);
11581172
11591173 QQuickItemPrivate::get(m_topSectionItem)->setCulled(false);