diff options
Diffstat (limited to 'src/declarative/graphicsitems')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativepath.cpp | 13 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativepath_p.h | 1 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativepath_p_p.h | 3 |
3 files changed, 16 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativepath.cpp b/src/declarative/graphicsitems/qdeclarativepath.cpp index e2042fc..e867a52 100644 --- a/src/declarative/graphicsitems/qdeclarativepath.cpp +++ b/src/declarative/graphicsitems/qdeclarativepath.cpp @@ -117,6 +117,7 @@ void QDeclarativePath::setStartX(qreal x) return; d->startX = x; emit startXChanged(); + processPath(); } qreal QDeclarativePath::startY() const @@ -132,6 +133,7 @@ void QDeclarativePath::setStartY(qreal y) return; d->startY = y; emit startYChanged(); + processPath(); } /*! @@ -220,6 +222,9 @@ void QDeclarativePath::processPath() { Q_D(QDeclarativePath); + if (!d->componentComplete) + return; + d->_pointCache.clear(); d->_attributePoints.clear(); d->_path = QPainterPath(); @@ -284,10 +289,18 @@ void QDeclarativePath::processPath() emit changed(); } +void QDeclarativePath::classBegin() +{ + Q_D(QDeclarativePath); + d->componentComplete = false; +} + void QDeclarativePath::componentComplete() { Q_D(QDeclarativePath); QSet<QString> attrs; + d->componentComplete = true; + // First gather up all the attributes foreach (QDeclarativePathElement *pathElement, d->_pathElements) { if (QDeclarativePathAttribute *attribute = diff --git a/src/declarative/graphicsitems/qdeclarativepath_p.h b/src/declarative/graphicsitems/qdeclarativepath_p.h index d7cfca1..17a2ea3 100644 --- a/src/declarative/graphicsitems/qdeclarativepath_p.h +++ b/src/declarative/graphicsitems/qdeclarativepath_p.h @@ -224,6 +224,7 @@ Q_SIGNALS: protected: virtual void componentComplete(); + virtual void classBegin(); private Q_SLOTS: void processPath(); diff --git a/src/declarative/graphicsitems/qdeclarativepath_p_p.h b/src/declarative/graphicsitems/qdeclarativepath_p_p.h index e82bcf5..994090e 100644 --- a/src/declarative/graphicsitems/qdeclarativepath_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativepath_p_p.h @@ -65,7 +65,7 @@ class QDeclarativePathPrivate : public QObjectPrivate Q_DECLARE_PUBLIC(QDeclarativePath) public: - QDeclarativePathPrivate() : startX(0), startY(0), closed(false) { } + QDeclarativePathPrivate() : startX(0), startY(0), closed(false), componentComplete(true) { } QPainterPath _path; QList<QDeclarativePathElement*> _pathElements; @@ -75,6 +75,7 @@ public: int startX; int startY; bool closed; + bool componentComplete; }; QT_END_NAMESPACE |