QmlDesigner: Fix reflection for CheckBox

Change-Id: Ib0268e5a015fb74c6691e7b3c51ca03f1f90ba55
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
This commit is contained in:
Thomas Hartmann
2024-04-16 11:23:19 +02:00
parent 75fc181b34
commit 1488548739

View File

@@ -22,17 +22,25 @@ StudioControls.CheckBox {
labelColor: colorLogic.textColor
property bool __block: false
ColorLogic {
id: colorLogic
backendValue: checkBox.backendValue
onValueFromBackendChanged: {
checkBox.__block = true
if (colorLogic.valueFromBackend !== undefined
&& checkBox.checked !== colorLogic.valueFromBackend)
checkBox.checked = colorLogic.valueFromBackend
checkBox.__block = false
}
}
onCheckedChanged: {
if (checkBox.__block)
return
if (backendValue.value !== checkBox.checked)
backendValue.value = checkBox.checked
}