Commit 07147a32 authored by Marco Bubke's avatar Marco Bubke
Browse files

QmlDesigner: Ask if the id exists instead of get the node and test it



Change-Id: I3604981fdeda7c3da67523d5d01b513b09037c7f
Reviewed-by: default avatarTim Jenssen <tim.jenssen@digia.com>
parent b8fb4a13
......@@ -112,13 +112,13 @@ static ModelNode resolveBinding(const QString &binding, ModelNode currentNode, A
else
return ModelNode(); //binding not valid
} else if (currentNode.hasProperty(element.toUtf8())) {
if (currentNode.property(element.toUtf8()).isNodeProperty()) {
if (currentNode.property(element.toUtf8()).isNodeProperty())
currentNode = currentNode.nodeProperty(element.toUtf8()).modelNode();
} else {
else if (view->hasId(element))
currentNode = view->modelNodeForId(element); //id
if (!currentNode.isValid())
return ModelNode(); //binding not valid
}
else
return ModelNode(); //binding not valid
} else {
currentNode = view->modelNodeForId(element); //id
}
......@@ -192,9 +192,8 @@ QList<ModelNode> BindingProperty::resolveToModelNodeList() const
string.remove(0, 1);
QStringList simplifiedList = commaSeparatedSimplifiedStringList(string);
foreach (const QString &nodeId, simplifiedList) {
ModelNode modelNode = view()->modelNodeForId(nodeId);
if (modelNode.isValid())
returnList.append(modelNode);
if (view()->hasId(nodeId))
returnList.append(view()->modelNodeForId(nodeId));
}
}
return returnList;
......
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