summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativelistview.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-02-24 07:48:20 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-02-24 07:48:20 (GMT)
commitd3a0bd57c7c3cecdeeb4ad9af3cf6bb4ee39964b (patch)
treeef5fd503f73819932ce1a240bd5ccfd287873edb /src/declarative/graphicsitems/qdeclarativelistview.cpp
parent40256d682e1a552c9566a744a66cc6fe008b578b (diff)
downloadQt-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.cpp2
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();