aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
diff options
context:
space:
mode:
authorJan Arve Sæther <jan-arve.saether@qt.io>2020-10-05 13:40:10 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-02-04 09:17:42 +0000
commite6dc083aa9e2bafde751e8779a61bb84d4fc9d79 (patch)
treeb86f88642552e4b8b8ef7488c7a43651d000d785 /tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
parent045718e821d1d1f1d5732f123c7a9c189bd92b19 (diff)
QQuickListView: Add autotest so that animated delegate does not crash
This is separate from the fix, since the test is supposed to also be merged into dev. (Where the fix was not needed) Task-number: QTBUG-86567 Change-Id: I2cf1a4b11eed4fe356588aeff322d3a432f0fe83 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 79014a1b39a4dca09a9d67de68161b10da4bcdef) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests/auto/quick/qquicklistview/tst_qquicklistview.cpp')
-rw-r--r--tests/auto/quick/qquicklistview/tst_qquicklistview.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
index 2af6b084fb..a7aefbe432 100644
--- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
+++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
@@ -298,6 +298,7 @@ private slots:
void requiredObjectListModel();
void clickHeaderAndFooterWhenClip();
+ void animatedDelegate();
private:
template <class T> void items(const QUrl &source);
@@ -10094,6 +10095,20 @@ void tst_QQuickListView::clickHeaderAndFooterWhenClip() // QTBUG-85302
QVERIFY(root->property("footerPressed").toBool());
}
+void tst_QQuickListView::animatedDelegate()
+{
+ // QTBUG-86567: Should not crash
+ QScopedPointer<QQuickView> window(createView());
+ window->setSource(testFileUrl("animatedDelegate.qml"));
+ window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
+
+ for (int i = 0; i < 100; ++i) {
+ QMetaObject::invokeMethod(window->rootObject(), "refreshModel");
+ QTest::qWait(10);
+ }
+}
+
QTEST_MAIN(tst_QQuickListView)
#include "tst_qquicklistview.moc"