diff options
author | Liang Qi <liang.qi@qt.io> | 2016-06-29 10:11:24 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-06-29 10:11:25 +0200 |
commit | 5f2249f4dcce7523d8dc88b425b43834c4c3cab9 (patch) | |
tree | 5ddbd03806a0f940cca2d4de966c2a00d761717b /tests/auto/quick/qquicklistview | |
parent | d5cb1bf4a9e19a0a4471ba5c935f441463a73414 (diff) | |
parent | 1b897195a14b63a553b139983736d8dfdd419ffd (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: I70c0c672708522f7157849365cc53ee271d8e460
Diffstat (limited to 'tests/auto/quick/qquicklistview')
-rw-r--r-- | tests/auto/quick/qquicklistview/tst_qquicklistview.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp index f5e79614df..b83edec996 100644 --- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp +++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp @@ -629,6 +629,8 @@ void tst_QQuickListView::inserted_more(QQuickItemView::VerticalLayoutDirection v } listview->setContentY(contentY); + QQuickItemViewPrivate::get(listview)->layout(); + QList<QPair<QString, QString> > newData; for (int i=0; i<insertCount; i++) newData << qMakePair(QString("value %1").arg(i), QString::number(i)); @@ -650,6 +652,16 @@ void tst_QQuickListView::inserted_more(QQuickItemView::VerticalLayoutDirection v QCOMPARE(item0->y(), itemsOffsetAfterMove); #endif + QList<FxViewItem *> visibleItems = QQuickItemViewPrivate::get(listview)->visibleItems; + for (QList<FxViewItem *>::const_iterator itemIt = visibleItems.begin(); itemIt != visibleItems.end(); ++itemIt) + { + FxViewItem *item = *itemIt; + if (item->item->position().y() >= 0 && item->item->position().y() < listview->height()) + { + QVERIFY(!QQuickItemPrivate::get(item->item)->culled); + } + } + QList<QQuickItem*> items = findItems<QQuickItem>(contentItem, "wrapper"); int firstVisibleIndex = -1; for (int i=0; i<items.count(); i++) { @@ -770,6 +782,11 @@ void tst_QQuickListView::inserted_more_data() << 80.0 // show 4-19 << 20 << 3 << 0.0; + + QTest::newRow("add multiple, within visible, content at start") + << 0.0 + << 2 << 50 + << 0.0; } void tst_QQuickListView::insertBeforeVisible() |