summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Gruendl <henning.gruendl@qt.io>2022-09-21 12:39:05 +0200
committerHenning Gründl <henning.gruendl@qt.io>2022-09-21 13:39:16 +0000
commit07c8f5249f8cf850b64e9330b0d13cb48a6024c6 (patch)
treed592265baad3d8a3757a0b3444bcef2ea0c1b129
parent95384d452691a65415b351e9ac3667b97188dcc5 (diff)
downloadqt-creator-07c8f5249f8cf850b64e9330b0d13cb48a6024c6.tar.gz
QmlDesigner: Fix empty when condition submit
Task-number: QDS-7729 Change-Id: Ia9ed1a911fd9ec5d6ffdcdb7ccfe0bb2ba843dc5 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r--share/qtcreator/qmldesigner/newstateseditor/StateMenu.qml4
-rw-r--r--share/qtcreator/qmldesigner/newstateseditor/StateThumbnail.qml8
2 files changed, 8 insertions, 4 deletions
diff --git a/share/qtcreator/qmldesigner/newstateseditor/StateMenu.qml b/share/qtcreator/qmldesigner/newstateseditor/StateMenu.qml
index 8d0bb8810c..d26572ebde 100644
--- a/share/qtcreator/qmldesigner/newstateseditor/StateMenu.qml
+++ b/share/qtcreator/qmldesigner/newstateseditor/StateMenu.qml
@@ -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 {}
diff --git a/share/qtcreator/qmldesigner/newstateseditor/StateThumbnail.qml b/share/qtcreator/qmldesigner/newstateseditor/StateThumbnail.qml
index ba7950781c..642ebd972d 100644
--- a/share/qtcreator/qmldesigner/newstateseditor/StateThumbnail.qml
+++ b/share/qtcreator/qmldesigner/newstateseditor/StateThumbnail.qml
@@ -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()