diff options
author | Martin Jones <martin.jones@nokia.com> | 2012-06-29 11:57:02 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-04 03:02:49 +0200 |
commit | baee77ef475056e045e2fa41f448a2703e2def07 (patch) | |
tree | 5ec91f0ed4d389ea1af0ef437a7fc3c7976fdc83 /tests | |
parent | 9bf96613c1be7d4df7132a9c3c9ac1a8740f698f (diff) |
Section headers ignore list delegate size changes when "colliding"
Make section header updates part of the layout process.
Task-number: QTBUG-23298
Change-Id: I4586bc58bc195fcc47f6db79346727eb6e3d3845
Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/quick/qquicklistview/tst_qquicklistview.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp index 7dba3a60b3..56bf2705a2 100644 --- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp +++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp @@ -2332,17 +2332,31 @@ void tst_QQuickListView::sectionsPositioning() QTRY_VERIFY(bottomItem = findVisibleChild(contentItem, "sect_new")); // section footer QTRY_COMPARE(bottomItem->y(), 300.); + // delegate size increase should push section footer down + listview->setContentY(70); + QTRY_COMPARE(QQuickItemPrivate::get(listview)->polishScheduled, false); + QTRY_VERIFY(bottomItem = findVisibleChild(contentItem, "sect_3")); // section footer + QTRY_COMPARE(bottomItem->y(), 370.); + QQuickItem *inlineSection = findVisibleChild(contentItem, "sect_new"); + item = findItem<QQuickItem>(contentItem, "wrapper", 13); + QVERIFY(item); + item->setHeight(40.); + QTRY_COMPARE(QQuickItemPrivate::get(listview)->polishScheduled, false); + QTRY_COMPARE(bottomItem->y(), 380.); + QCOMPARE(inlineSection->y(), 360.); + item->setHeight(20.); + // Turn sticky footer off listview->setContentY(20); - QTRY_COMPARE(QQuickItemPrivate::get(listview)->polishScheduled, false); canvas->rootObject()->setProperty("sectionPositioning", QVariant(int(QQuickViewSection::InlineLabels | QQuickViewSection::CurrentLabelAtStart))); + QTRY_COMPARE(QQuickItemPrivate::get(listview)->polishScheduled, false); QTRY_VERIFY(item = findVisibleChild(contentItem, "sect_new")); // inline label restored QCOMPARE(item->y(), 340.); // Turn sticky header off listview->setContentY(30); - QTRY_COMPARE(QQuickItemPrivate::get(listview)->polishScheduled, false); canvas->rootObject()->setProperty("sectionPositioning", QVariant(int(QQuickViewSection::InlineLabels))); + QTRY_COMPARE(QQuickItemPrivate::get(listview)->polishScheduled, false); QTRY_VERIFY(item = findVisibleChild(contentItem, "sect_aaa")); // inline label restored QCOMPARE(item->y(), 0.); |