Commit 23657d2c authored by Marco Bubke's avatar Marco Bubke
Browse files

Fix id setting in the ObjectNodeInstance

parent e31236a0
......@@ -152,10 +152,12 @@ void ObjectNodeInstance::setNodeInstance(NodeInstanceView *view)
void ObjectNodeInstance::setId(const QString &id)
{
if (!object()->objectName().isEmpty()) {
context()->engine()->rootContext()->setContextProperty(object()->objectName(), 0);
}
if (!id.isEmpty()) {
context()->engine()->rootContext()->setContextProperty(id, object()); // will also force refresh of all bindings
} else if (!object()->objectName().isEmpty()) {
context()->engine()->rootContext()->setContextProperty(object()->objectName(), 0);
}
object()->setObjectName(id);
......
Supports Markdown
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