forked from qt-creator/qt-creator
QmlDesigner: Fix crash
The return was placed incorrectly. A property called 'path' is required but not sufficient. Task-number: QDS-1430 Change-Id: I4dbae2fa0f63c36698c5db3480a65eb56fbdb96d Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -79,18 +79,18 @@ static int pathRankForModelNode(const ModelNode &modelNode) {
|
|||||||
if (modelNode.hasNodeProperty("path")) {
|
if (modelNode.hasNodeProperty("path")) {
|
||||||
ModelNode pathNode = modelNode.nodeProperty("path").modelNode();
|
ModelNode pathNode = modelNode.nodeProperty("path").modelNode();
|
||||||
if (pathNode.metaInfo().isSubclassOf("QtQuick.Path") && pathNode.hasNodeListProperty("pathElements")) {
|
if (pathNode.metaInfo().isSubclassOf("QtQuick.Path") && pathNode.hasNodeListProperty("pathElements")) {
|
||||||
QList<ModelNode> pathElements = pathNode.nodeListProperty("pathElements").toModelNodeList();
|
const QList<ModelNode> pathElements = pathNode.nodeListProperty("pathElements")
|
||||||
|
.toModelNodeList();
|
||||||
if (pathElements.isEmpty())
|
if (pathElements.isEmpty())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
foreach (const ModelNode &pathElement, pathElements) {
|
for (const ModelNode &pathElement : pathElements) {
|
||||||
if (isNonSupportedPathElement(pathElement))
|
if (isNonSupportedPathElement(pathElement))
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 20;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user