aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quick/qquicklistview/data/footer2.qml33
-rw-r--r--tests/auto/quick/qquicklistview/tst_qquicklistview.cpp16
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 fddba77f35..cfd740f33d 100644
--- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
+++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
@@ -152,6 +152,7 @@ private slots:
void headerChangesViewport();
void footer();
void footer_data();
+ void footer2();
void extents();
void extents_data();
void resetModel_headerFooter();
@@ -4138,6 +4139,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: