From 0b019fcc52560d0a7016f733cb2bea3e03893ec0 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 5 Nov 2012 13:51:58 +0100 Subject: [PATCH] QQmlPropertyCache: adding setParent() setParent() enables to dynamically set the parent of a QQmlPropertyCache. This is used in the Qt Quick Designer to create dynamic properties on an arbitrary object. Change-Id: I0dafabcacf4222fc1bfe693736cbd23e1e928e8f Reviewed-by: Kai Koehne Reviewed-by: Christiaan Janssen Reviewed-by: Marco Bubke --- src/qml/qml/qqmlpropertycache.cpp | 5 +++++ src/qml/qml/qqmlpropertycache_p.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/qml/qml/qqmlpropertycache.cpp b/src/qml/qml/qqmlpropertycache.cpp index c1c4a6c..8b02385 100644 --- a/src/qml/qml/qqmlpropertycache.cpp +++ b/src/qml/qml/qqmlpropertycache.cpp @@ -549,6 +549,11 @@ QQmlPropertyCache *QQmlPropertyCache::parent() const return _parent; } +void QQmlPropertyCache::setParent(QQmlPropertyCache *newParent) +{ + _parent = newParent; +} + // Returns the first C++ type's QMetaObject - that is, the first QMetaObject not created by // QML const QMetaObject *QQmlPropertyCache::firstCppMetaObject() const diff --git a/src/qml/qml/qqmlpropertycache_p.h b/src/qml/qml/qqmlpropertycache_p.h index 14be990..2804f66 100644 --- a/src/qml/qml/qqmlpropertycache_p.h +++ b/src/qml/qml/qqmlpropertycache_p.h @@ -294,6 +294,7 @@ public: QString defaultPropertyName() const; QQmlPropertyData *defaultProperty() const; QQmlPropertyCache *parent() const; + void setParent(QQmlPropertyCache *newParent); inline QQmlPropertyData *overrideData(QQmlPropertyData *) const; inline bool isAllowedInRevision(QQmlPropertyData *) const; -- 2.7.4