d->componentComplete = false;
}
-void QQuickPath::componentComplete()
+void QQuickPath::disconnectPathElements()
+{
+ Q_D(QQuickPath);
+
+ foreach (QQuickPathElement *pathElement, d->_pathElements)
+ disconnect(pathElement, SIGNAL(changed()), this, SLOT(processPath()));
+}
+
+void QQuickPath::connectPathElements()
+{
+ Q_D(QQuickPath);
+
+ foreach (QQuickPathElement *pathElement, d->_pathElements)
+ connect(pathElement, SIGNAL(changed()), this, SLOT(processPath()));
+}
+
+void QQuickPath::gatherAttributes()
{
Q_D(QQuickPath);
- QSet<QString> attrs;
- d->componentComplete = true;
+
+ QSet<QString> attributes;
// First gather up all the attributes
foreach (QQuickPathElement *pathElement, d->_pathElements) {
- if (QQuickCurve *curve =
- qobject_cast<QQuickCurve *>(pathElement))
+ if (QQuickCurve *curve = qobject_cast<QQuickCurve *>(pathElement))
d->_pathCurves.append(curve);
- else if (QQuickPathAttribute *attribute =
- qobject_cast<QQuickPathAttribute *>(pathElement))
- attrs.insert(attribute->name());
+ else if (QQuickPathAttribute *attribute = qobject_cast<QQuickPathAttribute *>(pathElement))
+ attributes.insert(attribute->name());
}
- d->_attributes = attrs.toList();
+
+ d->_attributes = attributes.toList();
+}
+
+void QQuickPath::componentComplete()
+{
+ Q_D(QQuickPath);
+ d->componentComplete = true;
+
+ gatherAttributes();
processPath();
- foreach (QQuickPathElement *pathElement, d->_pathElements)
- connect(pathElement, SIGNAL(changed()), this, SLOT(processPath()));
+ connectPathElements();
}
QPainterPath QQuickPath::path() const