aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hartmann <thomas.hartmann@qt.io>2021-03-24 20:51:06 +0100
committerThomas Hartmann <thomas.hartmann@qt.io>2021-03-25 08:49:50 +0000
commit9a95611e5417b7da92ee49534df9855442814b1a (patch)
tree42b5c2dad4e342e4683a6a5ddcc2b5ca31d85e68
parent52fad1870ed28304b0339e9d0cb4a5dc47674df7 (diff)
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>
-rw-r--r--src/plugins/qmldesigner/components/pathtool/pathtool.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/qmldesigner/components/pathtool/pathtool.cpp b/src/plugins/qmldesigner/components/pathtool/pathtool.cpp
index a01ae050ac..88fdd70f5f 100644
--- a/src/plugins/qmldesigner/components/pathtool/pathtool.cpp
+++ b/src/plugins/qmldesigner/components/pathtool/pathtool.cpp
@@ -79,18 +79,18 @@ static int pathRankForModelNode(const ModelNode &modelNode) {
if (modelNode.hasNodeProperty("path")) {
ModelNode pathNode = modelNode.nodeProperty("path").modelNode();
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())
return 0;
- foreach (const ModelNode &pathElement, pathElements) {
+ for (const ModelNode &pathElement : pathElements) {
if (isNonSupportedPathElement(pathElement))
return 0;
}
}
+ return 20;
}
-
- return 20;
}
return 0;