on xenial help sign in
Do not watch the geometry of the floating section item
a9624f4Albert Astals Cid
plugins/Dash/listviewwithpageheader.cpp+5−3
@@ -285,7 +285,7 @@ void ListViewWithPageHeader::setSectionDelegate(QQmlComponent *delegate)
285
285
286 m_sectionDelegate = delegate;
286 m_sectionDelegate = delegate;
287
287
288− m_topSectionItem = getSectionItem(QString());
288+ m_topSectionItem = getSectionItem(QString(), false /*watchGeometry*/);
289 m_topSectionItem->setZ(3);
289 m_topSectionItem->setZ(3);
290 QQuickItemPrivate::get(m_topSectionItem)->setCulled(true);
290 QQuickItemPrivate::get(m_topSectionItem)->setCulled(true);
291 connect(m_topSectionItem, &QQuickItem::heightChanged, this, &ListViewWithPageHeader::stickyHeaderHeightChanged);
291 connect(m_topSectionItem, &QQuickItem::heightChanged, this, &ListViewWithPageHeader::stickyHeaderHeightChanged);
@@ -746,7 +746,7 @@ QQuickItem *ListViewWithPageHeader::getSectionItem(int modelIndex, bool alreadyI
746 return getSectionItem(section);
746 return getSectionItem(section);
747}
747}
748
748
749−QQuickItem *ListViewWithPageHeader::getSectionItem(const QString &sectionText)
749+QQuickItem *ListViewWithPageHeader::getSectionItem(const QString &sectionText, bool watchGeometry)
750{
750{
751 QQuickItem *sectionItem = nullptr;
751 QQuickItem *sectionItem = nullptr;
752
752
@@ -770,7 +770,9 @@ QQuickItem *ListViewWithPageHeader::getSectionItem(const QString &sectionText)
770 }
770 }
771 m_sectionDelegate->completeCreate();
771 m_sectionDelegate->completeCreate();
772
772
773+ if (watchGeometry) {
773− QQuickItemPrivate::get(sectionItem)->addItemChangeListener(this, QQuickItemPrivate::Geometry);
774+ QQuickItemPrivate::get(sectionItem)->addItemChangeListener(this, QQuickItemPrivate::Geometry);
775+ }
774
776
775 return sectionItem;
777 return sectionItem;
776}
778}
plugins/Dash/listviewwithpageheader.h+1−1
@@ -166,7 +166,7 @@ private:
166 void reallyReleaseItem(ListItem *item);
166 void reallyReleaseItem(ListItem *item);
167 void updateWatchedRoles();
167 void updateWatchedRoles();
168 QQuickItem *getSectionItem(int modelIndex, bool alreadyInserted);
168 QQuickItem *getSectionItem(int modelIndex, bool alreadyInserted);
169− QQuickItem *getSectionItem(const QString &sectionText);
169+ QQuickItem *getSectionItem(const QString &sectionText, bool watchGeometry = true);
170 void updateSectionItem(int modelIndex);
170 void updateSectionItem(int modelIndex);
171 void initializeValuesForEmptyList();
171 void initializeValuesForEmptyList();
172
172