diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-02-24 07:48:20 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-02-24 07:48:20 (GMT) |
commit | d3a0bd57c7c3cecdeeb4ad9af3cf6bb4ee39964b (patch) | |
tree | ef5fd503f73819932ce1a240bd5ccfd287873edb /src/declarative/graphicsitems/qdeclarativelistview.cpp | |
parent | 40256d682e1a552c9566a744a66cc6fe008b578b (diff) | |
download | Qt-d3a0bd57c7c3cecdeeb4ad9af3cf6bb4ee39964b.zip Qt-d3a0bd57c7c3cecdeeb4ad9af3cf6bb4ee39964b.tar.gz Qt-d3a0bd57c7c3cecdeeb4ad9af3cf6bb4ee39964b.tar.bz2 |
Don't crash if the currentIndex is set while creating a delegate.
Task-number: QTBUG-8456
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativelistview.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativelistview.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index d471749..77e3a15 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -1580,6 +1580,8 @@ int QDeclarativeListView::currentIndex() const void QDeclarativeListView::setCurrentIndex(int index) { Q_D(QDeclarativeListView); + if (d->requestedIndex >= 0) // currently creating item + return; if (isComponentComplete() && d->isValid() && index != d->currentIndex && index < d->model->count() && index >= 0) { d->moveReason = QDeclarativeListViewPrivate::SetIndex; cancelFlick(); |