on xenial help sign in
Account for contentHeight not really being "all" of the content height
d5585fdAlbert Astals Cid
plugins/Dash/listviewwithpageheader.cpp+2−2
@@ -1186,7 +1186,7 @@ void ListViewWithPageHeader::headerHeightChanged(qreal newHeaderHeight, qreal ol
1186
1186
1187void ListViewWithPageHeader::adjustMinYExtent()
1187void ListViewWithPageHeader::adjustMinYExtent()
1188{
1188{
1189− if (m_visibleItems.isEmpty() || contentHeight() < height()) {
1189+ if (m_visibleItems.isEmpty() || (contentHeight() + m_minYExtent < height())) {
1190 m_minYExtent = 0;
1190 m_minYExtent = 0;
1191 } else {
1191 } else {
1192 qreal nonCreatedHeight = 0;
1192 qreal nonCreatedHeight = 0;
@@ -1368,7 +1368,7 @@ void ListViewWithPageHeader::updatePolish()
1368
1368
1369 m_contentHeightDirty = false;
1369 m_contentHeightDirty = false;
1370 adjustMinYExtent();
1370 adjustMinYExtent();
1371− if (contentHeight < height()) {
1371+ if (contentHeight + m_minYExtent < height()) {
1372 // need this since in the previous call to adjustMinYExtent contentHeight is not set yet
1372 // need this since in the previous call to adjustMinYExtent contentHeight is not set yet
1373 m_minYExtent = 0;
1373 m_minYExtent = 0;
1374 }
1374 }
tests/plugins/Dash/listviewwithpageheadertest.cpp+15
@@ -1977,6 +1977,21 @@ private Q_SLOTS:
1977 verifyItem(0, 50., 200., false);
1977 verifyItem(0, 50., 200., false);
1978 }
1978 }
1979
1979
1980+ void testBug1569976()
1981+ {
1982+ QMetaObject::invokeMethod(model, "removeItems", Q_ARG(QVariant, 3), Q_ARG(QVariant, 3));
1983+
1984+ for (int i = 0; i < 5; ++i) {
1985+ scrollToBottom();
1986+ lvwph->showHeader();
1987+ QTRY_VERIFY(!lvwph->m_contentYAnimation->isRunning());
1988+ scrollToTop();
1989+ }
1990+ verifyItem(0, 50., 150., false);
1991+ verifyItem(1, 200., 200., false);
1992+ verifyItem(2, 400., 350., false);
1993+ }
1994+
1980private:
1995private:
1981 QQuickView *view;
1996 QQuickView *view;
1982 ListViewWithPageHeader *lvwph;
1997 ListViewWithPageHeader *lvwph;