diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativegridview.cpp | 2 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativelistview.cpp | 2 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativepathview.cpp | 6 |
3 files changed, 7 insertions, 3 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index 0a103f3..4555dca 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -315,9 +315,9 @@ FxGridItem *QDeclarativeGridViewPrivate::createItem(int modelIndex) if (QDeclarativeItem *item = model->item(modelIndex, false)) { listItem = new FxGridItem(item, q); listItem->index = modelIndex; + listItem->item->setZValue(1); // complete model->completeItem(); - listItem->item->setZValue(1); listItem->item->setParent(q->viewport()); unrequestedItems.remove(listItem->item); } diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index e2cef23..03303a0 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -530,9 +530,9 @@ FxListItem *QDeclarativeListViewPrivate::createItem(int modelIndex) listItem->attached->m_prevSection = sectionAt(modelIndex-1); } } + listItem->item->setZValue(1); // complete model->completeItem(); - listItem->item->setZValue(1); listItem->item->setParent(q->viewport()); QDeclarativeItemPrivate *itemPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(item)); itemPrivate->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry); diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp index c131f4c..f1b0213 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview.cpp +++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp @@ -111,7 +111,7 @@ QDeclarativeItem *QDeclarativePathViewPrivate::getItem(int modelIndex) { Q_Q(QDeclarativePathView); requestedIndex = modelIndex; - QDeclarativeItem *item = model->item(modelIndex); + QDeclarativeItem *item = model->item(modelIndex, false); if (item) { if (QObject *obj = QDeclarativePathView::qmlAttachedProperties(item)) static_cast<QDeclarativePathViewAttached *>(obj)->setOnPath(true); @@ -655,6 +655,7 @@ void QDeclarativePathViewPrivate::regenerate() } items.append(item); item->setZValue(i); + model->completeItem(); if (currentIndex == index) item->setFocus(true); } @@ -715,6 +716,7 @@ void QDeclarativePathView::refill() int index = (d->firstIndex + d->items.count())%d->model->count(); QDeclarativeItem *item = d->getItem(index); item->setZValue(wrapIndex); + d->model->completeItem(); if (d->currentIndex == index) item->setFocus(true); d->items << item; @@ -731,6 +733,7 @@ void QDeclarativePathView::refill() d->firstIndex = d->model->count() - 1; QDeclarativeItem *item = d->getItem(d->firstIndex); item->setZValue(d->firstIndex); + d->model->completeItem(); if (d->currentIndex == d->firstIndex) item->setFocus(true); d->items.prepend(item); @@ -757,6 +760,7 @@ void QDeclarativePathView::itemsInserted(int modelIndex, int count) for (int i = 0; i < count; ++i) { QDeclarativeItem *item = d->getItem(modelIndex + i); item->setZValue(modelIndex + i); + d->model->completeItem(); d->items.insert(modelIndex + i, item); } refill(); |