diff options
author | Thomas Hartmann <Thomas.Hartmann@theqtcompany.com> | 2016-09-20 15:25:15 +0200 |
---|---|---|
committer | Thomas Hartmann <Thomas.Hartmann@theqtcompany.com> | 2016-09-22 10:57:29 +0000 |
commit | 325f63c732cc1d1a0882f275cc5b2803c9a0331b (patch) | |
tree | 1d7720492bb9f556bc34a095ed76f62479b9bc59 /src/plugins/qmldesigner/designercore/model/internalnode.cpp | |
parent | 6c4b05fd549e25d622913a74874b546441bf85c6 (diff) | |
download | qt-creator-325f63c732cc1d1a0882f275cc5b2803c9a0331b.tar.gz |
QmlDesigner: Implementing dynamic node properties
The model now supports dynamic node properties. e.g.:
Item {
property Item item: Item {
}
}
In this case Property::dynamicpropertyType() is Item and
Property::isDynamic() is true.
To create such a property I added:
NodeProperty::setDynamicTypeNameAndsetModelNode().
It is not supported to reparent nodes in an out of
dynamic node properties. The model throws an exception in this case.
This is currently not required on the application level and not
supported by the rewriter.
Change-Id: Ie05325663c481d8583dc45bee38b559c190fbb30
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src/plugins/qmldesigner/designercore/model/internalnode.cpp')
-rw-r--r-- | src/plugins/qmldesigner/designercore/model/internalnode.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/qmldesigner/designercore/model/internalnode.cpp b/src/plugins/qmldesigner/designercore/model/internalnode.cpp index 18b2b5d940..7e11ab6c3f 100644 --- a/src/plugins/qmldesigner/designercore/model/internalnode.cpp +++ b/src/plugins/qmldesigner/designercore/model/internalnode.cpp @@ -269,9 +269,10 @@ void InternalNode::addVariantProperty(const PropertyName &name) m_namePropertyHash.insert(name, newProperty); } -void InternalNode::addNodeProperty(const PropertyName &name) +void InternalNode::addNodeProperty(const PropertyName &name, const TypeName &dynamicTypeName) { - InternalProperty::Pointer newProperty(InternalNodeProperty::create(name, internalPointer())); + InternalNodeProperty::Pointer newProperty(InternalNodeProperty::create(name, internalPointer())); + newProperty->setDynamicTypeName(dynamicTypeName); m_namePropertyHash.insert(name, newProperty); } |