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.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
index f63793ca80..2af6b084fb 100644
--- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
+++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
@@ -297,6 +297,7 @@ private slots:
void objectModelCulling();
void requiredObjectListModel();
+ void clickHeaderAndFooterWhenClip();
private:
template <class T> void items(const QUrl &source);
@@ -10067,6 +10068,32 @@ void tst_QQuickListView::requiredObjectListModel()
}
}
+void tst_QQuickListView::clickHeaderAndFooterWhenClip() // QTBUG-85302
+{
+ QScopedPointer<QQuickView> window(createView());
+ window->setSource(testFileUrl("clickHeaderAndFooterWhenClip.qml"));
+ window->resize(640, 480);
+ window->show();
+
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
+ auto *root = window->rootObject();
+ QVERIFY(root);
+
+ auto *header = root->findChild<QQuickItem *>("header");
+ QVERIFY(header);
+
+ auto *footer = root->findChild<QQuickItem *>("footer");
+ QVERIFY(footer);
+
+ QVERIFY(root->property("headerPressed").isValid() && root->property("headerPressed").canConvert<bool>() && !root->property("headerPressed").toBool());
+ QTest::mouseClick(window.data(), Qt::LeftButton, Qt::NoModifier, header->mapToItem(root, QPoint(header->width() / 2, header->height() / 2)).toPoint());
+ QVERIFY(root->property("headerPressed").toBool());
+
+ QVERIFY(root->property("footerPressed").isValid() && root->property("footerPressed").canConvert<bool>() && !root->property("footerPressed").toBool());
+ QTest::mouseClick(window.data(), Qt::LeftButton, Qt::NoModifier, footer->mapToItem(root, QPoint(footer->width() / 2, footer->height() / 2)).toPoint());
+ QVERIFY(root->property("footerPressed").toBool());
+}
+
QTEST_MAIN(tst_QQuickListView)
#include "tst_qquicklistview.moc"