Commit 9e45ab31 authored by Stefan Dunca's avatar Stefan Dunca

Fix combobox usage

parent f6e72014
...@@ -229,6 +229,7 @@ Your vehicle will also be restarted in order to complete the process.") ...@@ -229,6 +229,7 @@ Your vehicle will also be restarted in order to complete the process.")
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
model: modelData.airframes model: modelData.airframes
textRole: "text"
Component.onCompleted: { Component.onCompleted: {
if (airframeCheckBox.checked) { if (airframeCheckBox.checked) {
......
...@@ -37,7 +37,15 @@ ComboBox { ...@@ -37,7 +37,15 @@ ComboBox {
width: control.width width: control.width
contentItem: Text { contentItem: Text {
text: textRole ? modelData[textRole] : modelData text: {
if(modelData) {
return textRole ? modelData[textRole] : modelData
}
else {
console.warn("ComboBox: no model data")
return ""
}
}
color: control.currentIndex === index ? qgcPal.buttonHighlightText : qgcPal.buttonText color: control.currentIndex === index ? qgcPal.buttonHighlightText : qgcPal.buttonText
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
} }
......
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