@@ -286,9 +286,11 @@ void ListViewWithPageHeader::setSectionDelegate(QQmlComponent *delegate)
286 m_sectionDelegate = delegate;
286 m_sectionDelegate = delegate;
288 m_topSectionItem = getSectionItem(QString(), false /*watchGeometry*/);
288 m_topSectionItem = getSectionItem(QString(), false /*watchGeometry*/);
289+ if (m_topSectionItem) {
289− m_topSectionItem->setZ(3);
290+ m_topSectionItem->setZ(3);
290− QQuickItemPrivate::get(m_topSectionItem)->setCulled(true);
291+ QQuickItemPrivate::get(m_topSectionItem)->setCulled(true);
291− connect(m_topSectionItem, &QQuickItem::heightChanged, this, &ListViewWithPageHeader::stickyHeaderHeightChanged);
292+ connect(m_topSectionItem, &QQuickItem::heightChanged, this, &ListViewWithPageHeader::stickyHeaderHeightChanged);
293 // TODO create sections for existing items
295 // TODO create sections for existing items
@@ -775,7 +777,7 @@ QQuickItem *ListViewWithPageHeader::getSectionItem(const QString §ionText, b
776 m_sectionDelegate->completeCreate();
778 m_sectionDelegate->completeCreate();
778− if (watchGeometry) {
780+ if (watchGeometry && sectionItem) {
779 QQuickItemPrivate::get(sectionItem)->addItemChangeListener(this, QQuickItemPrivate::Geometry);
781 QQuickItemPrivate::get(sectionItem)->addItemChangeListener(this, QQuickItemPrivate::Geometry);