summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativegridview.cpp
diff options
context:
space:
mode:
authorSami Lempinen <sami.lempinen@nokia.com>2011-03-17 11:29:50 (GMT)
committerSami Lempinen <sami.lempinen@nokia.com>2011-03-17 11:29:50 (GMT)
commitcefacacee367684e3637665984401c8e1073859c (patch)
tree97cdbc9b1ca275b90c1a761d5617ff12b244b2e4 /src/declarative/graphicsitems/qdeclarativegridview.cpp
parent130f8dce2f730811c3f1f0b4f45a3333c9a79600 (diff)
parentcbf6c5b810316efba3ccfb27f05576b8dbfe3890 (diff)
downloadQt-cefacacee367684e3637665984401c8e1073859c.zip
Qt-cefacacee367684e3637665984401c8e1073859c.tar.gz
Qt-cefacacee367684e3637665984401c8e1073859c.tar.bz2
Merge remote branch 'qt-master/master'
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativegridview.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index 5c2f781..c0cbed0 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -2834,11 +2834,9 @@ void QDeclarativeGridView::itemsInserted(int modelIndex, int count)
if (d->currentItem) {
d->currentItem->index = d->currentIndex;
d->currentItem->setPosition(d->colPosAt(d->currentIndex), d->rowPosAt(d->currentIndex));
- } else if (!d->currentIndex || (d->currentIndex < 0 && !d->currentIndexCleared)) {
- d->updateCurrent(0);
}
emit currentIndexChanged();
- } else if (d->itemCount == 0 && d->currentIndex == -1) {
+ } else if (d->itemCount == 0 && (!d->currentIndex || (d->currentIndex < 0 && !d->currentIndexCleared))) {
setCurrentIndex(0);
}
@@ -2906,6 +2904,8 @@ void QDeclarativeGridView::itemsRemoved(int modelIndex, int count)
d->currentIndex = -1;
if (d->itemCount)
d->updateCurrent(qMin(modelIndex, d->itemCount-1));
+ else
+ emit currentIndexChanged();
}
// update visibleIndex