diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-10-06 04:24:55 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-10-06 04:24:55 (GMT) |
commit | 8af64342922f05143c41d4804032bd223b89c17e (patch) | |
tree | 536a7230d2da0422b1635ecca6e3750a5ad660af /src | |
parent | eb126c11c72c82baf55f4b62e69cb138f4dce059 (diff) | |
parent | 0030599cbe39c9fc7d6f2632b4e66a54b1b46417 (diff) | |
download | Qt-8af64342922f05143c41d4804032bd223b89c17e.zip Qt-8af64342922f05143c41d4804032bd223b89c17e.tar.gz Qt-8af64342922f05143c41d4804032bd223b89c17e.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml:
Ensure PathView updates positions when path changes.
Create Loader components in correct context
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativeloader.cpp | 4 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativepathview.cpp | 17 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativepathview_p.h | 1 |
3 files changed, 19 insertions, 3 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp index 1066c2b..5647b14 100644 --- a/src/declarative/graphicsitems/qdeclarativeloader.cpp +++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp @@ -337,7 +337,9 @@ void QDeclarativeLoaderPrivate::_q_sourceLoaded() return; } - QDeclarativeContext *ctxt = new QDeclarativeContext(qmlContext(q)); + QDeclarativeContext *creationContext = component->creationContext(); + if (!creationContext) creationContext = qmlContext(q); + QDeclarativeContext *ctxt = new QDeclarativeContext(creationContext); ctxt->setContextObject(q); QDeclarativeComponent *c = component; 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; |