|
|
|
@ -14,6 +14,17 @@ QGCComboBox {
@@ -14,6 +14,17 @@ QGCComboBox {
|
|
|
|
|
|
|
|
|
|
currentIndex: fact ? (indexModel ? fact.value : fact.enumIndex) : 0 |
|
|
|
|
|
|
|
|
|
onModelChanged: { |
|
|
|
|
// When the model changes, the index gets reset to 0, so make sure to |
|
|
|
|
// restore it correctly. |
|
|
|
|
// Since enumIndex could trigger a model change, we use callLater() to |
|
|
|
|
// avoid an event binding loop (the 2. call will for certain not trigger |
|
|
|
|
// another model change) |
|
|
|
|
Qt.callLater(function() { |
|
|
|
|
currentIndex = fact ? (indexModel ? fact.value : fact.enumIndex) : 0 |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
onActivated: { |
|
|
|
|
if (indexModel) { |
|
|
|
|
fact.value = index |
|
|
|
|