From 9a95611e5417b7da92ee49534df9855442814b1a Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 24 Mar 2021 20:51:06 +0100 Subject: [PATCH] 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 --- src/plugins/qmldesigner/components/pathtool/pathtool.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/qmldesigner/components/pathtool/pathtool.cpp b/src/plugins/qmldesigner/components/pathtool/pathtool.cpp index a01ae050acd..88fdd70f5f3 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 pathElements = pathNode.nodeListProperty("pathElements").toModelNodeList(); + const QList 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;