aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates/qquicktumbler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quicktemplates/qquicktumbler.cpp')
-rw-r--r--src/quicktemplates/qquicktumbler.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/quicktemplates/qquicktumbler.cpp b/src/quicktemplates/qquicktumbler.cpp
index e7f6606de3..cfff191fc1 100644
--- a/src/quicktemplates/qquicktumbler.cpp
+++ b/src/quicktemplates/qquicktumbler.cpp
@@ -298,6 +298,12 @@ void QQuickTumbler::setModel(const QVariant &model)
d->endSetModel();
+ if (d->view && d->currentIndexSetDuringModelChange) {
+ const int viewCurrentIndex = d->view->property("currentIndex").toInt();
+ if (viewCurrentIndex != d->currentIndex)
+ d->view->setProperty("currentIndex", d->currentIndex);
+ }
+
d->currentIndexSetDuringModelChange = false;
// Don't try to correct the currentIndex if count() isn't known yet.