diff options
Diffstat (limited to 'tests/auto/quick/qquicklistview/tst_qquicklistview.cpp')
-rw-r--r-- | tests/auto/quick/qquicklistview/tst_qquicklistview.cpp | 27 |
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 132c42ec1f..51a753c199 100644 --- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp +++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp @@ -298,6 +298,7 @@ private slots: void objectModelCulling(); void requiredObjectListModel(); + void clickHeaderAndFooterWhenClip(); private: template <class T> void items(const QUrl &source); @@ -10075,6 +10076,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" |