summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-10-07 00:37:50 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-10-07 00:37:50 (GMT)
commit0ed462973acc683882ac30ae6959340564f305a3 (patch)
treeda826b812a6c489275f4c6dd85b4b4ee8a27266a /src/declarative
parent7d79beeb4c88d4e5fb8d7aecd8dd07419b465f55 (diff)
downloadQt-0ed462973acc683882ac30ae6959340564f305a3.zip
Qt-0ed462973acc683882ac30ae6959340564f305a3.tar.gz
Qt-0ed462973acc683882ac30ae6959340564f305a3.tar.bz2
Fix setting PathView offset when all visible items are removed.
If we remove all items then we don't have a valid firstIndex with which to anchor item positions, so just use offset. Task-number: QTBUG-14199 Reviewed-by: Michael Brasser
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp
index 3ae8788..31943b2 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp
@@ -1331,6 +1331,8 @@ void QDeclarativePathView::refill()
if (idx >= d->modelCount)
idx = 0;
}
+ if (!d->items.count())
+ d->firstIndex = -1;
if (d->modelCount) {
// add items to beginning and end