Commit 8a4426ac authored by Don Gagne's avatar Don Gagne

New FactBitmask control

parent 50f2056b
...@@ -76,6 +76,7 @@ ...@@ -76,6 +76,7 @@
<file alias="QGroundControl/Controls/VehicleSummaryRow.qml">src/QmlControls/VehicleSummaryRow.qml</file> <file alias="QGroundControl/Controls/VehicleSummaryRow.qml">src/QmlControls/VehicleSummaryRow.qml</file>
<file alias="QGroundControl/Controls/ViewWidget.qml">src/ViewWidgets/ViewWidget.qml</file> <file alias="QGroundControl/Controls/ViewWidget.qml">src/ViewWidgets/ViewWidget.qml</file>
<file alias="QGroundControl/Controls/FactSliderPanel.qml">src/QmlControls/FactSliderPanel.qml</file> <file alias="QGroundControl/Controls/FactSliderPanel.qml">src/QmlControls/FactSliderPanel.qml</file>
<file alias="QGroundControl/FactControls/FactBitmask.qml">src/FactSystem/FactControls/FactBitmask.qml</file>
<file alias="QGroundControl/FactControls/FactCheckBox.qml">src/FactSystem/FactControls/FactCheckBox.qml</file> <file alias="QGroundControl/FactControls/FactCheckBox.qml">src/FactSystem/FactControls/FactCheckBox.qml</file>
<file alias="QGroundControl/FactControls/FactComboBox.qml">src/FactSystem/FactControls/FactComboBox.qml</file> <file alias="QGroundControl/FactControls/FactComboBox.qml">src/FactSystem/FactControls/FactComboBox.qml</file>
<file alias="QGroundControl/FactControls/FactLabel.qml">src/FactSystem/FactControls/FactLabel.qml</file> <file alias="QGroundControl/FactControls/FactLabel.qml">src/FactSystem/FactControls/FactLabel.qml</file>
......
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]
}
}
}
}
}
...@@ -18,7 +18,7 @@ QGCComboBox { ...@@ -18,7 +18,7 @@ QGCComboBox {
if (indexModel) { if (indexModel) {
fact.value = index fact.value = index
} else { } else {
fact.enumIndex = index fact.value = fact.enumValues[index]
} }
} }
} }
Module QGroundControl.FactControls Module QGroundControl.FactControls
FactPanel 1.0 FactPanel.qml FactBitmask 1.0 FactBitmask.qml
FactLabel 1.0 FactLabel.qml FactCheckBox 1.0 FactCheckBox.qml
FactTextField 1.0 FactTextField.qml FactComboBox 1.0 FactComboBox.qml
FactCheckBox 1.0 FactCheckBox.qml FactLabel 1.0 FactLabel.qml
FactComboBox 1.0 FactComboBox.qml FactPanel 1.0 FactPanel.qml
\ No newline at end of file FactTextField 1.0 FactTextField.qml
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment