QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
LabelledComboBox.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Layouts
3
4import QGroundControl
5import QGroundControl.Controls
6
7RowLayout {
8 property alias label: label.text
9 property alias model: _comboBox.model
10 property alias textRole: _comboBox.textRole
11 property alias valueRole: _comboBox.valueRole
12 property alias currentIndex: _comboBox.currentIndex
13 property alias currentText: _comboBox.currentText
14 property alias currentValue: _comboBox.currentValue
15 property alias alternateText: _comboBox.alternateText
16 property var comboBox: _comboBox
17 property real comboBoxPreferredWidth: -1
18
19 spacing: ScreenTools.defaultFontPixelWidth
20
21 signal activated(int index)
22
23 QGCLabel {
24 id: label
25 Layout.fillWidth: true
26 Layout.minimumWidth: implicitWidth
27 }
28
29 QGCComboBox {
30 id: _comboBox
31 Layout.preferredWidth: comboBoxPreferredWidth
32 sizeToContents: true
33 onActivated: (index) => { parent.activated(index) }
34 }
35}