Skip to content
FactCheckBox.qml 670 B
Newer Older
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.4
Don Gagne's avatar
Don Gagne committed
import QGroundControl.FactSystem 1.0
import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0
Don Gagne's avatar
Don Gagne committed

QGCCheckBox {
    property Fact fact: Fact { }
    property variant checkedValue:   1
    property variant uncheckedValue: 0
    checkedState: fact ?
                      (fact.typeIsBool ?
Gus Grubba's avatar
Gus Grubba committed
                           (fact.value === false ? Qt.Unchecked : Qt.Checked) :
                           (fact.value === 0 ? Qt.Unchecked : Qt.Checked)) :
                      Qt.Unchecked
Don Gagne's avatar
Don Gagne committed

    text: qsTr("Label")
Don Gagne's avatar
Don Gagne committed

    onClicked: fact.value == checked ? checkedValue : uncheckedValue
Don Gagne's avatar
Don Gagne committed
}