on xenial help sign in
Fix LVWPH test failing on Xenial (Qt 5.5)

This is the simplest of the ways of fixing the problem i found. The issue is that flickable code doesn't play very well with the situation in which you have a contentHeight smaller than height and you reimplement minYExtent but not maxYExtent and minYExtent is returning a negative value. The other solutions involve implementing maxYExtent figuring out why minYExtent ends up being negative on Qt 5.5 and not in Qt 5.4 Implementing maxYExtent seemed too much work and open a new can of worms The different values of minYExtent in Qt 5.5 vs 5.4 are most probably ok since it's just different order invokations lead to different minyExtent+friends combinations that basically represent the same thing So I ended up making sure the minYExtent is never negative (because it's 0) if the contentHeight is smaller than the height of the list Approved by: Michael Terry

commitcf2219b716b60ddf6f584bcfd74430687352b029 authorAlbert Astals Cid <albert.astals@canonical.com> dateMon 11 Jan 2016, 17:37 (11 years ago) parentceb9a1fc45aa00
1 file changed+5−1
plugins/Dash/listviewwithpageheader.cpp+5−1
plugins/Dash/listviewwithpageheader.cpp+5−1
@@ -1177,7 +1177,7 @@ void ListViewWithPageHeader::headerHeightChanged(qreal newHeaderHeight, qreal ol
11771177
11781178void ListViewWithPageHeader::adjustMinYExtent()
11791179{
1180− if (m_visibleItems.isEmpty()) {
1180+ if (m_visibleItems.isEmpty() || contentHeight() < height()) {
11811181 m_minYExtent = 0;
11821182 } else {
11831183 qreal nonCreatedHeight = 0;
@@ -1359,6 +1359,10 @@ void ListViewWithPageHeader::updatePolish()
13591359
13601360 m_contentHeightDirty = false;
13611361 adjustMinYExtent();
1362+ if (contentHeight < height()) {
1363+ // need this since in the previous call to adjustMinYExtent contentHeight is not set yet
1364+ m_minYExtent = 0;
1365+ }
13621366 m_inContentHeightKeepHeaderShown = m_headerItem && m_headerItem->y() == contentY();
13631367 setContentHeight(contentHeight);
13641368 m_inContentHeightKeepHeaderShown = false;