diff --git a/src/gui/Base/HCheckBox.qml b/src/gui/Base/HCheckBox.qml index 22e34e88..471a3eaf 100644 --- a/src/gui/Base/HCheckBox.qml +++ b/src/gui/Base/HCheckBox.qml @@ -12,6 +12,8 @@ CheckBox { property bool defaultChecked: false readonly property bool changed: checked !== defaultChecked + property bool previousDefaultChecked: false // private + function reset() { checked = defaultChecked } @@ -92,5 +94,15 @@ CheckBox { } } + onDefaultCheckedChanged: { + if (checked === previousDefaultChecked) + checked = Qt.binding(() => defaultChecked) + + previousDefaultChecked = defaultChecked + } + + // Break binding + Component.onCompleted: previousDefaultChecked = previousDefaultChecked + Behavior on opacity { HNumberAnimation { factor: 2 } } }