aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/items/qsggridview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/items/qsggridview.cpp')
-rw-r--r--src/declarative/items/qsggridview.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/declarative/items/qsggridview.cpp b/src/declarative/items/qsggridview.cpp
index 214481a288..7b0e4f3e9a 100644
--- a/src/declarative/items/qsggridview.cpp
+++ b/src/declarative/items/qsggridview.cpp
@@ -1445,6 +1445,15 @@ void QSGGridView::itemsRemoved(int modelIndex, int count)
}
}
+ // update visibleIndex
+ d->visibleIndex = 0;
+ for (it = d->visibleItems.begin(); it != d->visibleItems.end(); ++it) {
+ if ((*it)->index != -1) {
+ d->visibleIndex = (*it)->index;
+ break;
+ }
+ }
+
// fix current
if (d->currentIndex >= modelIndex + count) {
d->currentIndex -= count;
@@ -1462,15 +1471,6 @@ void QSGGridView::itemsRemoved(int modelIndex, int count)
emit currentIndexChanged();
}
- // update visibleIndex
- d->visibleIndex = 0;
- for (it = d->visibleItems.begin(); it != d->visibleItems.end(); ++it) {
- if ((*it)->index != -1) {
- d->visibleIndex = (*it)->index;
- break;
- }
- }
-
if (removedVisible && d->visibleItems.isEmpty()) {
d->timeline.clear();
if (d->itemCount == 0) {