aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util/qquickpath.cpp
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@digia.com>2013-04-24 14:01:20 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-24 21:36:01 +0200
commit3ca95a92835b92c9aeb6abbb7a26de73e3170ece (patch)
tree30e8f4053510685ee9ddb4ed0f394ee540da5f8d /src/quick/util/qquickpath.cpp
parent7c683dd625421f33a5456c3bdd457c6e4072a64d (diff)
Make pathElements designer ready
The append and clear case was not handled before but the designer is changing the pathElements. Change-Id: I373e26a7c597774c3e985a8c26a564700e9ee9de Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Diffstat (limited to 'src/quick/util/qquickpath.cpp')
-rw-r--r--src/quick/util/qquickpath.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/quick/util/qquickpath.cpp b/src/quick/util/qquickpath.cpp
index 0b0c330e73..fc33f8f1f8 100644
--- a/src/quick/util/qquickpath.cpp
+++ b/src/quick/util/qquickpath.cpp
@@ -213,8 +213,24 @@ QQuickPathElement *QQuickPath::pathElements_at(QQmlListProperty<QQuickPathElemen
void QQuickPath::pathElements_append(QQmlListProperty<QQuickPathElement> *property, QQuickPathElement *pathElement)
{
QQuickPathPrivate *d = privatePath(property->object);
+ QQuickPath *path = static_cast<QQuickPath*>(property->object);
d->_pathElements.append(pathElement);
+
+ if (d->componentComplete) {
+ QQuickCurve *curve = qobject_cast<QQuickCurve *>(pathElement);
+ if (curve)
+ d->_pathCurves.append(curve);
+ else {
+ QQuickPathAttribute *attribute = qobject_cast<QQuickPathAttribute *>(pathElement);
+ if (attribute && !d->_attributes.contains(attribute->name()))
+ d->_attributes.append(attribute->name());
+ }
+
+ path->processPath();
+
+ connect(pathElement, SIGNAL(changed()), path, SLOT(processPath()));
+ }
}
int QQuickPath::pathElements_count(QQmlListProperty<QQuickPathElement> *property)
@@ -227,8 +243,12 @@ int QQuickPath::pathElements_count(QQmlListProperty<QQuickPathElement> *property
void QQuickPath::pathElements_clear(QQmlListProperty<QQuickPathElement> *property)
{
QQuickPathPrivate *d = privatePath(property->object);
+ QQuickPath *path = static_cast<QQuickPath*>(property->object);
+ path->disconnectPathElements();
d->_pathElements.clear();
+ d->_pathCurves.clear();
+ d->_pointCache.clear();
}
void QQuickPath::interpolate(int idx, const QString &name, qreal value)