Skip to content
Snippets Groups Projects
Commit 8a4426ac authored by Don Gagne's avatar Don Gagne
Browse files

New FactBitmask control

parent 50f2056b
No related branches found
No related tags found
No related merge requests found
...@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment