Commit 316bfcae authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.Model: Fix isComponent for Loader



Loader was also interpreted as a component, but the handling
of component and sourceComponent was incorrect.

Change-Id: I5cd691ece1a29c77b52dc74785013f08d589b2eb
Reviewed-by: default avatarTim Jenssen <tim.jenssen@digia.com>
parent 798af5d7
......@@ -1061,9 +1061,27 @@ bool ModelNode::isComponent() const
}
if (metaInfo().isSubclassOf("QtQuick.Loader", -1 , -1)) {
if (hasNodeProperty("component")
&& nodeProperty("component").modelNode().nodeSourceType() == ModelNode::NodeWithComponentSource)
if (hasNodeListProperty("component")) {
/*
* The component property should be a NodeProperty, but currently is a NodeListProperty, because
* the default property is always implcitly a NodeListProperty. This is something that has to be fixed.
*/
ModelNode componentNode = nodeListProperty("component").toModelNodeList().first();
if (componentNode.nodeSourceType() == ModelNode::NodeWithComponentSource)
return true;
if (componentNode.metaInfo().isFileComponent())
return true;
}
if (hasNodeProperty("sourceComponent")) {
if (nodeProperty("sourceComponent").modelNode().nodeSourceType() == ModelNode::NodeWithComponentSource)
return true;
if (nodeProperty("sourceComponent").modelNode().metaInfo().isFileComponent())
return true;
}
if (hasVariantProperty("source"))
return true;
......
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