@@ -280,7 +280,7 @@ void ListViewWithPageHeader::setSectionDelegate(QQmlComponent *delegate)
281 m_sectionDelegate = delegate;
281 m_sectionDelegate = delegate;
283− m_topSectionItem = getSectionItem(-1, QString());
283+ m_topSectionItem = getSectionItem(QString());
284 m_topSectionItem->setZ(3);
284 m_topSectionItem->setZ(3);
285 QQuickItemPrivate::get(m_topSectionItem)->setCulled(true);
285 QQuickItemPrivate::get(m_topSectionItem)->setCulled(true);
@@ -651,17 +651,17 @@ QQuickItem *ListViewWithPageHeader::getSectionItem(int modelIndex, bool alreadyI
654− return getSectionItem(modelIndex, section);
654+ return getSectionItem(section);
657−QQuickItem *ListViewWithPageHeader::getSectionItem(int modelIndex, const QString §ionText)
657+QQuickItem *ListViewWithPageHeader::getSectionItem(const QString §ionText)
659 QQuickItem *sectionItem = nullptr;
659 QQuickItem *sectionItem = nullptr;
661 QQmlContext *creationContext = m_sectionDelegate->creationContext();
661 QQmlContext *creationContext = m_sectionDelegate->creationContext();
662 QQmlContext *context = new QQmlContext(creationContext ? creationContext : qmlContext(this));
662 QQmlContext *context = new QQmlContext(creationContext ? creationContext : qmlContext(this));
663 context->setContextProperty(QLatin1String("section"), sectionText);
663 context->setContextProperty(QLatin1String("section"), sectionText);
664− context->setContextProperty(QLatin1String("delegateIndex"), modelIndex);
664+ context->setContextProperty(QLatin1String("delegateIndex"), -1);
665 QObject *nobj = m_sectionDelegate->beginCreate(context);
665 QObject *nobj = m_sectionDelegate->beginCreate(context);
666 if (nobj) {
666 if (nobj) {
667 QQml_setParent_noEvent(context, nobj);
667 QQml_setParent_noEvent(context, nobj);