aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickpathview.cpp
diff options
context:
space:
mode:
authorSérgio Martins <sergio.martins@kdab.com>2014-09-30 13:23:56 +0100
committerSérgio Martins <sergio.martins@kdab.com>2014-10-10 11:30:06 +0200
commit2b5e9534450404fba3bdf89f304d0504ae8587dd (patch)
tree93e869bf0e2e70fdf96c325c45bc5d859a520a2d /src/quick/items/qquickpathview.cpp
parent9e71faae038de4c41c206f1321da1b37ab6ca8b1 (diff)
PathView: Fix QML engine thinking currentItem is null when it's not
QML didn't re-evaluate any bindings using currentItem because a notification was missing. Change-Id: Icdaa3022e0b01644a060e577d87f011b4ea9fabb Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Diffstat (limited to 'src/quick/items/qquickpathview.cpp')
-rw-r--r--src/quick/items/qquickpathview.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/quick/items/qquickpathview.cpp b/src/quick/items/qquickpathview.cpp
index 00a5400eb2..825845eca9 100644
--- a/src/quick/items/qquickpathview.cpp
+++ b/src/quick/items/qquickpathview.cpp
@@ -1987,12 +1987,14 @@ void QQuickPathView::refill()
}
}
+ bool currentChanged = false;
if (!currentVisible) {
d->currentItemOffset = 1.0;
if (d->currentItem) {
d->updateItem(d->currentItem, 1.0);
} else if (!waiting && d->currentIndex >= 0 && d->currentIndex < d->modelCount) {
if ((d->currentItem = d->getItem(d->currentIndex, d->currentIndex))) {
+ currentChanged = true;
d->updateItem(d->currentItem, 1.0);
if (QQuickPathViewAttached *att = d->attached(d->currentItem))
att->setIsCurrentItem(true);
@@ -2000,6 +2002,7 @@ void QQuickPathView::refill()
}
} else if (!waiting && !d->currentItem) {
if ((d->currentItem = d->getItem(d->currentIndex, d->currentIndex))) {
+ currentChanged = true;
d->currentItem->setFocus(true);
if (QQuickPathViewAttached *att = d->attached(d->currentItem))
att->setIsCurrentItem(true);
@@ -2019,6 +2022,8 @@ void QQuickPathView::refill()
d->releaseItem(d->itemCache.takeLast());
d->inRefill = false;
+ if (currentChanged)
+ emit currentItemChanged();
}
void QQuickPathView::modelUpdated(const QQmlChangeSet &changeSet, bool reset)