aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qquicklistview/tst_qquicklistview.cpp')
-rw-r--r--tests/auto/quick/qquicklistview/tst_qquicklistview.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
index f14a6e75f6..bab2ec34f8 100644
--- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
+++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
@@ -278,6 +278,7 @@ private slots:
void addOnCompleted();
void setPositionOnLayout();
void touchCancel();
+ void resizeAfterComponentComplete();
private:
template <class T> void items(const QUrl &source);
@@ -9020,6 +9021,21 @@ void tst_QQuickListView::touchCancel() // QTBUG-74679
QTRY_COMPARE(listview->contentY(), 500.0);
}
+void tst_QQuickListView::resizeAfterComponentComplete() // QTBUG-76487
+{
+ QScopedPointer<QQuickView> window(createView());
+ window->setSource(testFileUrl("resizeAfterComponentComplete.qml"));
+ window->resize(640, 480);
+ window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
+
+ QObject *listView = window->rootObject();
+ QVERIFY(listView);
+
+ QObject *lastItem = qvariant_cast<QObject *>(listView->property("lastItem"));
+ QTRY_COMPARE(lastItem->property("y").toInt(), 9 * lastItem->property("height").toInt());
+}
+
QTEST_MAIN(tst_QQuickListView)
#include "tst_qquicklistview.moc"