diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-04-14 23:35:23 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-04-14 23:35:23 (GMT) |
commit | 114f627d14e7c4f06f82a7286c38c78388fe7623 (patch) | |
tree | f225ae5cb062fe60c91b5bb3fa12676bf854fefc /src/declarative | |
parent | 4174dd5dca647bfbe5ff5db1d495b7f887833323 (diff) | |
download | Qt-114f627d14e7c4f06f82a7286c38c78388fe7623.zip Qt-114f627d14e7c4f06f82a7286c38c78388fe7623.tar.gz Qt-114f627d14e7c4f06f82a7286c38c78388fe7623.tar.bz2 |
Don't create delegates when destroying view.
Task-number: QTBUG-9840
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativelistview.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index cf7b96f..307c0a7 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -521,7 +521,6 @@ void QDeclarativeListViewPrivate::clear() trackedItem = 0; minExtentDirty = true; maxExtentDirty = true; - setPosition(0); itemCount = 0; } @@ -708,6 +707,7 @@ void QDeclarativeListViewPrivate::layout() layoutScheduled = false; if (!isValid()) { clear(); + setPosition(0); return; } updateSections(); @@ -1416,6 +1416,7 @@ void QDeclarativeListView::setModel(const QVariant &model) disconnect(d->model, SIGNAL(destroyingItem(QDeclarativeItem*)), this, SLOT(destroyingItem(QDeclarativeItem*))); } d->clear(); + d->setPosition(0); d->modelVariant = model; QObject *object = qvariant_cast<QObject*>(model); QDeclarativeVisualModel *vim = 0; @@ -1770,6 +1771,7 @@ void QDeclarativeListView::setOrientation(QDeclarativeListView::Orientation orie setFlickDirection(HorizontalFlick); } d->clear(); + d->setPosition(0); refill(); emit orientationChanged(); d->updateCurrent(d->currentIndex); @@ -2791,6 +2793,7 @@ void QDeclarativeListView::modelReset() { Q_D(QDeclarativeListView); d->clear(); + d->setPosition(0); refill(); d->moveReason = QDeclarativeListViewPrivate::SetIndex; d->updateCurrent(d->currentIndex); |