Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
cacheBuffer makes delegates appear briefly in wrong position
Set delegates that are created asynchronously to non-visible.  This
would have happened the next time addVisibleItems() was called.

Task-number: QTBUG-24364
Change-Id: I4b628bef186c8c41bd6a4d9e4ac402d59bcb4972
Reviewed-by: Bea Lam <bea.lam@nokia.com>
  • Loading branch information
Martin Jones authored and Qt by Nokia committed Feb 21, 2012
1 parent 2954685 commit b01aec8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/quick/items/qquickitemview.cpp
Expand Up @@ -2754,6 +2754,8 @@ void QQuickItemView::initItem(int index, QQuickItem *item)
Q_D(QQuickItemView);
item->setZ(1);
if (d->requestedIndex == index) {
if (d->requestedAsync)
item->setVisible(false);
item->setParentItem(contentItem());
QDeclarative_setParent_noEvent(item, contentItem());
d->requestedItem = d->newViewItem(index, item);
Expand Down
3 changes: 1 addition & 2 deletions tests/auto/qtquick2/qquicklistview/tst_qquicklistview.cpp
Expand Up @@ -2095,8 +2095,7 @@ void tst_QQuickListView::sectionsPositioning()
listview->setContentY(20);
QTRY_COMPARE(QQuickItemPrivate::get(listview)->polishScheduled, false);
canvas->rootObject()->setProperty("sectionPositioning", QVariant(int(QQuickViewSection::InlineLabels | QQuickViewSection::CurrentLabelAtStart)));
item = findVisibleChild(contentItem, "sect_new"); // inline label restored
QVERIFY(item);
QTRY_VERIFY(item = findVisibleChild(contentItem, "sect_new")); // inline label restored
QCOMPARE(item->y(), 340.);

// Turn sticky header off
Expand Down

0 comments on commit b01aec8

Please sign in to comment.