Allow current item creation to interrupt async delegate creation.

Fixes unstable test tst_QQuickGridView::insertBeforeVisible().

Change-Id: Iebf02d3c4c202b300409be567906c64c02917dda
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
This commit is contained in:
Martin Jones 2011-12-01 14:30:44 +10:00 committed by Qt by Nokia
parent e6bafe1096
commit 8a338a3bba
1 changed files with 1 additions and 1 deletions

View File

@ -307,7 +307,7 @@ int QQuickItemView::currentIndex() const
void QQuickItemView::setCurrentIndex(int index) void QQuickItemView::setCurrentIndex(int index)
{ {
Q_D(QQuickItemView); Q_D(QQuickItemView);
if (d->requestedIndex >= 0) // currently creating item if (d->requestedIndex >= 0 && !d->requestedAsync) // currently creating item
return; return;
d->currentIndexCleared = (index == -1); d->currentIndexCleared = (index == -1);