From d969661b331b9c4431d637b45653d80e9e03c161 Mon Sep 17 00:00:00 2001 From: Ad5001 Date: Fri, 21 Oct 2022 15:40:01 +0200 Subject: [PATCH] Fixing autocompletion in case object does not exist. --- .../eu/ad5001/LogarithmPlotter/Setting/ExpressionEditor.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Setting/ExpressionEditor.qml b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Setting/ExpressionEditor.qml index f0d8f17..34cc4b3 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Setting/ExpressionEditor.qml +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Setting/ExpressionEditor.qml @@ -328,7 +328,7 @@ Item { id: objectPropertiesList category: qsTr("Object Properties") - visbilityCondition: isEnteringProperty + visbilityCondition: doesObjectExist itemStartIndex: 0 itemSelected: parent.itemSelected property bool isEnteringProperty: ( @@ -339,7 +339,8 @@ Item { property string objectName: isEnteringProperty ? (parent.currentToken.dot ? parent.previousToken.value : parent.previousToken2.value) : "" - property var objectProperties: isEnteringProperty ? + property bool doesObjectExist: isEnteringProperty && objectName in Objects.currentObjectsByName + property var objectProperties: doesObjectExist ? Objects.currentObjectsByName[objectName].constructor.properties() : {} categoryItems: Object.keys(objectProperties)