Commit d43a4710 authored by Marco Bubke's avatar Marco Bubke
Browse files

change setNodeInstance in setNodeInstanceView

parent 9e079d3a
......@@ -181,7 +181,7 @@ NodeInstance NodeInstance::create(NodeInstanceView *nodeInstanceView, const Mode
instance.m_nodeInstance->setModelNode(node);
instance.m_nodeInstance->setNodeInstance(nodeInstanceView);
instance.m_nodeInstance->setNodeInstanceView(nodeInstanceView);
instance.setId(node.id());
......@@ -198,7 +198,7 @@ NodeInstance NodeInstance::create(NodeInstanceView *nodeInstanceView, const Mode
NodeInstance NodeInstance::create(NodeInstanceView *nodeInstanceView, const NodeMetaInfo &metaInfo, QmlContext *context)
{
NodeInstance instance(createInstance(metaInfo, context, 0));
instance.m_nodeInstance->setNodeInstance(nodeInstanceView);
instance.m_nodeInstance->setNodeInstanceView(nodeInstanceView);
return instance;
}
......
......@@ -93,6 +93,10 @@ ObjectNodeInstance::ObjectNodeInstance(QObject *object)
m_object(object),
m_metaObject(0)
{
if (modelNode().isRootNode())
m_metaObject = new NodeInstanceMetaObject(object, context());
else
m_metaObject = new NodeInstanceMetaObject(object, 0);
}
ObjectNodeInstance::~ObjectNodeInstance()
......@@ -701,13 +705,6 @@ static bool metaObjectHasNotPropertyName(NodeInstanceMetaObject *metaObject, con
void ObjectNodeInstance::createDynamicProperty(const QString &name, const QString &/*typeName*/)
{
if (m_metaObject == 0) {
if (modelNode().isRootNode())
m_metaObject = new NodeInstanceMetaObject(object(), context());
else
m_metaObject = new NodeInstanceMetaObject(object(), 0);
}
if (metaObjectHasNotPropertyName(m_metaObject, name))
m_metaObject->createNewProperty(name);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment