QQmlPropertyCache: adding setParent()
authorThomas Hartmann <Thomas.Hartmann@digia.com>
Mon, 5 Nov 2012 12:51:58 +0000 (13:51 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 5 Nov 2012 14:17:31 +0000 (15:17 +0100)
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 <kai.koehne@digia.com>
Reviewed-by: Christiaan Janssen <christiaan.janssen@digia.com>
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
src/qml/qml/qqmlpropertycache.cpp
src/qml/qml/qqmlpropertycache_p.h

index c1c4a6c..8b02385 100644 (file)
@@ -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
index 14be990..2804f66 100644 (file)
@@ -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;