Fixing autocompletion in case object does not exist.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Ad5001 2022-10-21 15:40:01 +02:00
parent 86656fe46c
commit d969661b33
Signed by: Ad5001
GPG key ID: 7251B1AF90B960F9

View file

@ -328,7 +328,7 @@ Item {
id: objectPropertiesList id: objectPropertiesList
category: qsTr("Object Properties") category: qsTr("Object Properties")
visbilityCondition: isEnteringProperty visbilityCondition: doesObjectExist
itemStartIndex: 0 itemStartIndex: 0
itemSelected: parent.itemSelected itemSelected: parent.itemSelected
property bool isEnteringProperty: ( property bool isEnteringProperty: (
@ -339,7 +339,8 @@ Item {
property string objectName: isEnteringProperty ? property string objectName: isEnteringProperty ?
(parent.currentToken.dot ? parent.previousToken.value : parent.previousToken2.value) (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() : Objects.currentObjectsByName[objectName].constructor.properties() :
{} {}
categoryItems: Object.keys(objectProperties) categoryItems: Object.keys(objectProperties)