QmlDesigner: Fix empty when condition submit

Task-number: QDS-7729
Change-Id: Ia9ed1a911fd9ec5d6ffdcdb7ccfe0bb2ba843dc5
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Henning Gruendl
2022-09-21 12:39:05 +02:00
committed by Henning Gründl
parent 95384d4526
commit 07c8f5249f
2 changed files with 8 additions and 4 deletions

View File

@@ -87,9 +87,7 @@ StudioControls.Menu {
StudioControls.MenuItem {
enabled: !root.isBaseState && root.hasWhenCondition
text: qsTr("Reset when Condition")
onTriggered: {
statesEditorModel.resetWhenCondition(internalNodeId)
}
onTriggered: root.resetWhenCondition()
}
StudioControls.MenuSeparator {}

View File

@@ -654,7 +654,12 @@ Item {
return
whenCondition.previousCondition = whenCondition.text
root.whenConditionFinished()
if (whenCondition.text !== "")
root.whenConditionFinished()
else
statesEditorModel.resetWhenCondition(root.internalNodeId)
}
Component.onCompleted: whenCondition.previousCondition = whenCondition.text
@@ -694,6 +699,7 @@ Item {
onExtend: root.extend()
onRemove: root.remove()
onToggle: root.propertyChangesVisible = !root.propertyChangesVisible
onResetWhenCondition: statesEditorModel.resetWhenCondition(root.internalNodeId)
onEditAnnotation: {
statesEditorModel.setAnnotation(root.internalNodeId)
stateMenu.hasAnnotation = root.checkAnnotation()