forked from qt-creator/qt-creator
QmlDesigner: Fix reflection for CheckBox
Change-Id: Ib0268e5a015fb74c6691e7b3c51ca03f1f90ba55 Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
This commit is contained in:
@@ -22,17 +22,25 @@ StudioControls.CheckBox {
|
|||||||
|
|
||||||
labelColor: colorLogic.textColor
|
labelColor: colorLogic.textColor
|
||||||
|
|
||||||
|
property bool __block: false
|
||||||
|
|
||||||
ColorLogic {
|
ColorLogic {
|
||||||
id: colorLogic
|
id: colorLogic
|
||||||
backendValue: checkBox.backendValue
|
backendValue: checkBox.backendValue
|
||||||
onValueFromBackendChanged: {
|
onValueFromBackendChanged: {
|
||||||
|
checkBox.__block = true
|
||||||
if (colorLogic.valueFromBackend !== undefined
|
if (colorLogic.valueFromBackend !== undefined
|
||||||
&& checkBox.checked !== colorLogic.valueFromBackend)
|
&& checkBox.checked !== colorLogic.valueFromBackend)
|
||||||
checkBox.checked = colorLogic.valueFromBackend
|
checkBox.checked = colorLogic.valueFromBackend
|
||||||
|
checkBox.__block = false
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
|
if (checkBox.__block)
|
||||||
|
return
|
||||||
|
|
||||||
if (backendValue.value !== checkBox.checked)
|
if (backendValue.value !== checkBox.checked)
|
||||||
backendValue.value = checkBox.checked
|
backendValue.value = checkBox.checked
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user