Skip to content

Commit

Permalink
New FactBitmask control
Browse files Browse the repository at this point in the history
  • Loading branch information
DonLakeFlyer committed Dec 29, 2015
1 parent 50f2056 commit 8a4426a
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 6 deletions.
1 change: 1 addition & 0 deletions qgroundcontrol.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
<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/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/FactComboBox.qml">src/FactSystem/FactControls/FactComboBox.qml</file>
<file alias="QGroundControl/FactControls/FactLabel.qml">src/FactSystem/FactControls/FactLabel.qml</file>
Expand Down
30 changes: 30 additions & 0 deletions src/FactSystem/FactControls/FactBitmask.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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]
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/FactSystem/FactControls/FactComboBox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ QGCComboBox {
if (indexModel) {
fact.value = index
} else {
fact.enumIndex = index
fact.value = fact.enumValues[index]
}
}
}
11 changes: 6 additions & 5 deletions src/FactSystem/FactControls/qmldir
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Module QGroundControl.FactControls

FactPanel 1.0 FactPanel.qml
FactLabel 1.0 FactLabel.qml
FactTextField 1.0 FactTextField.qml
FactCheckBox 1.0 FactCheckBox.qml
FactComboBox 1.0 FactComboBox.qml
FactBitmask 1.0 FactBitmask.qml
FactCheckBox 1.0 FactCheckBox.qml
FactComboBox 1.0 FactComboBox.qml
FactLabel 1.0 FactLabel.qml
FactPanel 1.0 FactPanel.qml
FactTextField 1.0 FactTextField.qml

0 comments on commit 8a4426a

Please sign in to comment.