Browse Source

Fixed checked state logic and restore checkedValue and uncheckedValue properties.

QGC4.4
Gus Grubba 7 years ago
parent
commit
64da8d9fb8
  1. 5
      src/FactSystem/FactControls/FactCheckBox.qml

5
src/FactSystem/FactControls/FactCheckBox.qml

@ -8,7 +8,8 @@ import QGroundControl.Controls 1.0 @@ -8,7 +8,8 @@ import QGroundControl.Controls 1.0
QGCCheckBox {
property Fact fact: Fact { }
property variant checkedValue: 1
property variant uncheckedValue: 0
checkedState: fact ?
(fact.typeIsBool ?
(fact.value === false ? Qt.Unchecked : Qt.Checked) :
@ -17,5 +18,5 @@ QGCCheckBox { @@ -17,5 +18,5 @@ QGCCheckBox {
text: qsTr("Label")
onClicked: fact.value = checked ? 1 : 0
onClicked: fact.value == checked ? checkedValue : uncheckedValue
}

Loading…
Cancel
Save