diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-06-28 13:28:09 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-06-28 13:28:10 +0200 |
commit | 63398defdbec12979b61120f690e984af0496c37 (patch) | |
tree | ab7a29ea0040d46c47004fed3c211a831bc48e9c /tests/auto/quick/qquicklistview | |
parent | cff8d9f1d2d309cd9417bb93386a1443ed1892c3 (diff) | |
parent | 692b2da77427259a3589cf8a1311075863f2f5ec (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I59343fe228ca6b823b61577e5a0907e7381899c2
Diffstat (limited to 'tests/auto/quick/qquicklistview')
-rw-r--r-- | tests/auto/quick/qquicklistview/data/footer2.qml | 33 | ||||
-rw-r--r-- | tests/auto/quick/qquicklistview/tst_qquicklistview.cpp | 16 |
2 files changed, 49 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicklistview/data/footer2.qml b/tests/auto/quick/qquicklistview/data/footer2.qml new file mode 100644 index 0000000000..bba74d89f7 --- /dev/null +++ b/tests/auto/quick/qquicklistview/data/footer2.qml @@ -0,0 +1,33 @@ +import QtQuick 2.0 + +Rectangle { + width: 240 + height: 320 + + Timer { + running: true + repeat: false + interval: 100 + onTriggered: { + list.model -= 3; + } + } + + ListView { + id: list + objectName: "list" + anchors.fill: parent + model: 3 + delegate: Rectangle { + color: "red" + width: 240 + height: 10 + } + footer: Rectangle { + color: "blue" + width: 240 + height: 10 + } + } +} + diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp index 2ea8a477a8..39df10b9d9 100644 --- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp +++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp @@ -153,6 +153,7 @@ private slots: void headerChangesViewport(); void footer(); void footer_data(); + void footer2(); void extents(); void extents_data(); void resetModel_headerFooter(); @@ -4139,6 +4140,21 @@ void tst_QQuickListView::footer_data() << QPointF(0, -(30 * 20) - 10); } +void tst_QQuickListView::footer2() // QTBUG-31677 +{ + QQuickView *window = getView(); + window->setSource(testFileUrl("footer2.qml")); + window->show(); + QVERIFY(QTest::qWaitForWindowExposed(window)); + + QQuickListView *listview = findItem<QQuickListView>(window->rootObject(), "list"); + QTRY_VERIFY(listview != nullptr); + + QQuickItem *footer = listview->footerItem(); + QVERIFY(footer != nullptr); + QTRY_COMPARE(footer->y(), 0.0); +} + class LVAccessor : public QQuickListView { public: |