Commit 49e39513 authored by Jacob Walser's avatar Jacob Walser

Handle null facts in Values Widget

parent 513d1583
......@@ -65,11 +65,18 @@ QGCFlickable {
Repeater {
model: _activeVehicle ? controller.largeValues : 0
Loader {
sourceComponent: fact ? largeValue : undefined
property Fact fact: _activeVehicle.getFact(modelData.replace("Vehicle.", ""))
}
} // Repeater - Large
} // Column - Large
Component {
id: largeValue
Column {
width: _largeColumn.width
property Fact fact: _activeVehicle.getFact(modelData.replace("Vehicle.", ""))
property bool largeValue: _root.listContains(controller.altitudeProperties, fact.name)
QGCLabel {
......@@ -89,8 +96,7 @@ QGCFlickable {
text: fact.valueString
}
}
} // Repeater - Large
} // Column - Large
}
Flow {
id: _smallFlow
......@@ -102,13 +108,20 @@ QGCFlickable {
Repeater {
model: _activeVehicle ? controller.smallValues : 0
Loader {
sourceComponent: fact ? smallValue : undefined
property Fact fact: _activeVehicle.getFact(modelData.replace("Vehicle.", ""))
}
} // Repeater - Small
} // Flow
Component {
id: smallValue
Column {
width: (_root.width / 2) - (_margins / 2) - 0.1
clip: true
property Fact fact: _activeVehicle.getFact(modelData.replace("Vehicle.", ""))
QGCLabel {
width: parent.width
horizontalAlignment: Text.AlignHCenter
......@@ -133,8 +146,7 @@ QGCFlickable {
text: fact.units
}
}
} // Repeater - Small
} // Flow
}
Component {
id: propertyPicker
......
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