FactBitmask.qml 729 Bytes
Newer Older
Don Gagne's avatar
Don Gagne committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
import QtQuick          2.5
import QtQuick.Controls 1.2

import QGroundControl.FactSystem    1.0
import QGroundControl.Palette       1.0
import QGroundControl.Controls      1.0
import QGroundControl.ScreenTools   1.0

Row {
    spacing: ScreenTools.defaultFontPixelWidth

    property Fact fact: Fact { }

    Repeater {
        model: fact.bitmaskStrings

        QGCCheckBox {
            text:       modelData
            checked:    fact.value & fact.bitmaskValues[index]

            onClicked: {
                if (checked) {
                    fact.value |= fact.bitmaskValues[index]
                } else {
                    fact.value &= ~fact.bitmaskValues[index]
                }
            }
        }
    }
}