Commit 033a094a authored by Marco Bubke's avatar Marco Bubke
Browse files

Fix id removing

Task-number: BAUHAUS-267
parent c7b719c4
...@@ -152,13 +152,13 @@ void ObjectNodeInstance::setNodeInstance(NodeInstanceView *view) ...@@ -152,13 +152,13 @@ void ObjectNodeInstance::setNodeInstance(NodeInstanceView *view)
void ObjectNodeInstance::setId(const QString &id) void ObjectNodeInstance::setId(const QString &id)
{ {
object()->setObjectName(id);
if (!id.isEmpty()) { if (!id.isEmpty()) {
context()->engine()->rootContext()->setContextProperty(id, object()); // will also force refresh of all bindings context()->engine()->rootContext()->setContextProperty(id, object()); // will also force refresh of all bindings
} else { } else if (!object()->objectName().isEmpty()) {
context()->engine()->rootContext()->setContextProperty(id, 0); context()->engine()->rootContext()->setContextProperty(object()->objectName(), 0);
} }
object()->setObjectName(id);
} }
bool ObjectNodeInstance::isQmlGraphicsItem() const bool ObjectNodeInstance::isQmlGraphicsItem() const
......
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