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