You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
627 B
24 lines
627 B
import QtQuick 2.2 |
|
import QtQuick.Controls 1.2 |
|
import QtQuick.Controls.Styles 1.2 |
|
|
|
import QGroundControl.FactSystem 1.0 |
|
import QGroundControl.Palette 1.0 |
|
import QGroundControl.Controls 1.0 |
|
|
|
QGCComboBox { |
|
property Fact fact: Fact { } |
|
property bool indexModel: true ///< true: model must be specifed, selected index is fact value, false: use enum meta data |
|
|
|
model: fact ? fact.enumStrings : null |
|
|
|
currentIndex: indexModel ? fact.value : fact.enumIndex |
|
|
|
onActivated: { |
|
if (indexModel) { |
|
fact.value = index |
|
} else { |
|
fact.value = fact.enumValues[index] |
|
} |
|
} |
|
}
|
|
|