FactCheckBox.qml 568 Bytes
Newer Older
1 2
import QtQuick 2.3
import QtQuick.Controls 1.2
3
import QtQuick.Controls.Styles 1.4
4

Don Gagne's avatar
Don Gagne committed
5
import QGroundControl.FactSystem 1.0
6
import QGroundControl.Palette 1.0
7
import QGroundControl.Controls 1.0
Don Gagne's avatar
Don Gagne committed
8

9
QGCCheckBox {
10
    property Fact fact: Fact { }
Don Gagne's avatar
Don Gagne committed
11

12 13
    checkedState: fact ?
                      (fact.typeIsBool ?
Gus Grubba's avatar
Gus Grubba committed
14 15
                           (fact.value === false ? Qt.Unchecked : Qt.Checked) :
                           (fact.value === 0 ? Qt.Unchecked : Qt.Checked)) :
16
                      Qt.Unchecked
Don Gagne's avatar
Don Gagne committed
17

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

20
    onClicked: fact.value = checked ? 1 : 0
Don Gagne's avatar
Don Gagne committed
21
}