summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-10-06 03:59:19 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-10-06 04:02:07 (GMT)
commit0030599cbe39c9fc7d6f2632b4e66a54b1b46417 (patch)
treebb05e0eaaf09e8274ce57ce8fd286f6625b07b98 /src
parentbb8ba98542e1ed363d4218b9a9a4e68a6c4b5337 (diff)
downloadQt-0030599cbe39c9fc7d6f2632b4e66a54b1b46417.zip
Qt-0030599cbe39c9fc7d6f2632b4e66a54b1b46417.tar.gz
Qt-0030599cbe39c9fc7d6f2632b4e66a54b1b46417.tar.bz2
Ensure PathView updates positions when path changes.
Fixes regression caused by optimization added in commit 35a51442ed21f58c06b21293eeb56e843251ee82. Task-number: QTBUG-14239 Reviewed-by: Martin Jones
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview.cpp17
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview_p.h1
2 files changed, 16 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp
index d134929..3ae8788 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp
@@ -300,6 +300,19 @@ void QDeclarativePathViewPrivate::setHighlightPosition(qreal pos)
}
}
+void QDeclarativePathView::pathUpdated()
+{
+ Q_D(QDeclarativePathView);
+ QList<QDeclarativeItem*>::iterator it = d->items.begin();
+ while (it != d->items.end()) {
+ QDeclarativeItem *item = *it;
+ if (QDeclarativePathViewAttached *att = d->attached(item))
+ att->m_percent = -1;
+ ++it;
+ }
+ refill();
+}
+
void QDeclarativePathViewPrivate::updateItem(QDeclarativeItem *item, qreal percent)
{
if (QDeclarativePathViewAttached *att = attached(item)) {
@@ -526,9 +539,9 @@ void QDeclarativePathView::setPath(QDeclarativePath *path)
if (d->path == path)
return;
if (d->path)
- disconnect(d->path, SIGNAL(changed()), this, SLOT(refill()));
+ disconnect(d->path, SIGNAL(changed()), this, SLOT(pathUpdated()));
d->path = path;
- connect(d->path, SIGNAL(changed()), this, SLOT(refill()));
+ connect(d->path, SIGNAL(changed()), this, SLOT(pathUpdated()));
if (d->isValid() && isComponentComplete()) {
d->clear();
if (d->attType) {
diff --git a/src/declarative/graphicsitems/qdeclarativepathview_p.h b/src/declarative/graphicsitems/qdeclarativepathview_p.h
index 62a8c44..7775b1c 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepathview_p.h
@@ -186,6 +186,7 @@ private Q_SLOTS:
void modelReset();
void createdItem(int index, QDeclarativeItem *item);
void destroyingItem(QDeclarativeItem *item);
+ void pathUpdated();
private:
friend class QDeclarativePathViewAttached;