summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx/qfxpathview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/fx/qfxpathview.cpp')
-rw-r--r--src/declarative/fx/qfxpathview.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/declarative/fx/qfxpathview.cpp b/src/declarative/fx/qfxpathview.cpp
index 810a359..715ae5a 100644
--- a/src/declarative/fx/qfxpathview.cpp
+++ b/src/declarative/fx/qfxpathview.cpp
@@ -699,6 +699,12 @@ void QFxPathView::itemsRemoved(int modelIndex, int count)
d->regenerate();
}
+ if (d->model->count() == 0) {
+ d->currentIndex = -1;
+ d->moveOffset.setValue(0);
+ return;
+ }
+
// make sure the current item is still at the snap position
if (d->currentIndex >= d->model->count())
d->currentIndex = d->model->count() - 1;