on xenial help sign in
adjustMinYExtent more often

should be more robust on slow CI where stuff happens in different "order"

commitd53037472443f70ce7bbbe9a69bd13d5caae7fa2 authorAlbert Astals <albert.astals@canonical.com> dateThu 20 Jun 2013, 13:26 (13 years ago) parent93d1eb4
3 files changed+8−7
plugins/ListViewWithPageHeader/listviewwithpageheader.cpp+2−1 tests/plugins/ListViewWithPageHeader/listviewwithpageheadertest.cpp+2−2 tests/plugins/ListViewWithPageHeader/listviewwithpageheadertestsection.cpp+4−4
plugins/ListViewWithPageHeader/listviewwithpageheader.cpp+2−1
@@ -650,8 +650,8 @@ ListViewWithPageHeader::ListItem *ListViewWithPageHeader::createItem(int modelIn
650650 }
651651 if (m_firstVisibleIndex < 0 || modelIndex < m_firstVisibleIndex) {
652652 m_firstVisibleIndex = modelIndex;
653− adjustMinYExtent();
654653 }
654+ adjustMinYExtent();
655655 }
656656 return listItem;
657657 }
@@ -831,6 +831,7 @@ void ListViewWithPageHeader::itemGeometryChanged(QQuickItem *item, const QRectF
831831 }
832832 }
833833 refill();
834+ adjustMinYExtent();
834835 polish();
835836 m_contentHeightDirty = true;
836837 }
tests/plugins/ListViewWithPageHeader/listviewwithpageheadertest.cpp+2−2
@@ -1086,7 +1086,7 @@ private Q_SLOTS:
10861086 verifyItem(2, 192, 350., false);
10871087 verifyItem(3, 542, 125., true);
10881088 verifyItem(4, 667, 100., true);
1089− QCOMPARE(lvwph->m_minYExtent, 350.);
1089+ QCOMPARE(lvwph->m_minYExtent, 65.);
10901090 QCOMPARE(lvwph->m_clipItem->y(), 1258.);
10911091 QCOMPARE(lvwph->m_clipItem->clip(), false);
10921092 QCOMPARE(lvwph->m_headerItem->y(), 0.);
@@ -1345,7 +1345,7 @@ private Q_SLOTS:
13451345 verifyItem(1, -158, 350., false);
13461346 verifyItem(2, 192, 350., false);
13471347 verifyItem(3, 542, 150., true);
1348− QCOMPARE(lvwph->m_minYExtent, 0.);
1348+ QCOMPARE(lvwph->m_minYExtent, -100.);
13491349 QCOMPARE(lvwph->m_clipItem->y(), 1258.);
13501350 QCOMPARE(lvwph->m_clipItem->clip(), false);
13511351 QCOMPARE(lvwph->m_headerItem->y(), 0.);
tests/plugins/ListViewWithPageHeader/listviewwithpageheadertestsection.cpp+4−4
@@ -1025,7 +1025,7 @@ private Q_SLOTS:
10251025 verifyItem(1, 70, 390., false, "Bold", false);
10261026 verifyItem(2, 460, 350., false, QString(), false);
10271027 verifyItem(3, 810, 390., true, "Lazy", true);
1028− QCOMPARE(lvwph->m_minYExtent, 970./3.);
1028+ QCOMPARE(lvwph->m_minYExtent, 330.);
10291029 QCOMPARE(lvwph->m_clipItem->y(), 800.);
10301030 QCOMPARE(lvwph->m_clipItem->clip(), false);
10311031 QCOMPARE(lvwph->m_headerItem->y(), 0.);
@@ -1235,7 +1235,7 @@ private Q_SLOTS:
12351235 verifyItem(2, 152, 390., false, "Lazy", false);
12361236 verifyItem(3, 542, 165., true, "Regular", true);
12371237 verifyItem(4, 707, 140., true, "Agressive", true);
1238− QCOMPARE(lvwph->m_minYExtent, 310.);
1238+ QCOMPARE(lvwph->m_minYExtent, 41.);
12391239 QCOMPARE(lvwph->m_clipItem->y(), 1458.);
12401240 QCOMPARE(lvwph->m_clipItem->clip(), false);
12411241 QCOMPARE(lvwph->m_headerItem->y(), 0.);
@@ -1480,7 +1480,7 @@ private Q_SLOTS:
14801480 verifyItem(1, -40, 390., false, "Mild", true);
14811481 verifyItem(2, 350, 390., false, "Bold", false);
14821482 verifyItem(3, 740, 390., true, "Lazy", true);
1483− QCOMPARE(lvwph->m_minYExtent, 152.5);
1483+ QCOMPARE(lvwph->m_minYExtent, 162.5);
14841484 QCOMPARE(lvwph->m_clipItem->y(), 520.);
14851485 QCOMPARE(lvwph->m_clipItem->clip(), false);
14861486 QCOMPARE(lvwph->m_headerItem->y(), 0.);
@@ -1558,7 +1558,7 @@ private Q_SLOTS:
15581558 verifyItem(1, -198, 350., false, QString(), true);
15591559 verifyItem(2, 152, 390., false, "Lazy", false);
15601560 verifyItem(3, 542, 190., true, "Agressive", true);
1561− QCOMPARE(lvwph->m_minYExtent, -200./3.);
1561+ QCOMPARE(lvwph->m_minYExtent, -160.);
15621562 QCOMPARE(lvwph->m_clipItem->y(), 1458.);
15631563 QCOMPARE(lvwph->m_clipItem->clip(), false);
15641564 QCOMPARE(lvwph->m_headerItem->y(), 0.);