on xenial help sign in
Do not watch the geometry of the floating section item
commita9624f4527643553732fc2fc8b3a0c186ed3cb38 authorAlbert Astals Cid <albert.astals@canonical.com> dateWed 16 Mar 2016, 11:25 (11 years ago) parent034c42e
2 files changed+6−4
plugins/Dash/listviewwithpageheader.cpp+5−3 plugins/Dash/listviewwithpageheader.h+1−1
plugins/Dash/listviewwithpageheader.cpp+5−3
@@ -285,7 +285,7 @@ void ListViewWithPageHeader::setSectionDelegate(QQmlComponent *delegate)
285285
286286 m_sectionDelegate = delegate;
287287
288− m_topSectionItem = getSectionItem(QString());
288+ m_topSectionItem = getSectionItem(QString(), false /*watchGeometry*/);
289289 m_topSectionItem->setZ(3);
290290 QQuickItemPrivate::get(m_topSectionItem)->setCulled(true);
291291 connect(m_topSectionItem, &QQuickItem::heightChanged, this, &ListViewWithPageHeader::stickyHeaderHeightChanged);
@@ -746,7 +746,7 @@ QQuickItem *ListViewWithPageHeader::getSectionItem(int modelIndex, bool alreadyI
746746 return getSectionItem(section);
747747}
748748
749−QQuickItem *ListViewWithPageHeader::getSectionItem(const QString &sectionText)
749+QQuickItem *ListViewWithPageHeader::getSectionItem(const QString &sectionText, bool watchGeometry)
750750{
751751 QQuickItem *sectionItem = nullptr;
752752
@@ -770,7 +770,9 @@ QQuickItem *ListViewWithPageHeader::getSectionItem(const QString &sectionText)
770770 }
771771 m_sectionDelegate->completeCreate();
772772
773− QQuickItemPrivate::get(sectionItem)->addItemChangeListener(this, QQuickItemPrivate::Geometry);
773+ if (watchGeometry) {
774+ QQuickItemPrivate::get(sectionItem)->addItemChangeListener(this, QQuickItemPrivate::Geometry);
775+ }
774776
775777 return sectionItem;
776778}
plugins/Dash/listviewwithpageheader.h+1−1
@@ -166,7 +166,7 @@ private:
166166 void reallyReleaseItem(ListItem *item);
167167 void updateWatchedRoles();
168168 QQuickItem *getSectionItem(int modelIndex, bool alreadyInserted);
169− QQuickItem *getSectionItem(const QString &sectionText);
169+ QQuickItem *getSectionItem(const QString &sectionText, bool watchGeometry = true);
170170 void updateSectionItem(int modelIndex);
171171 void initializeValuesForEmptyList();
172172