QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
LabelledFactComboBox.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Layouts
3
4import QGroundControl
5import QGroundControl.Controls
6import QGroundControl.FactControls
7
8GridLayout {
9 property alias label: label.text
10 property alias fact: _comboBox.fact
11 property alias indexModel: _comboBox.indexModel
12 property var comboBox: _comboBox
13 property real comboBoxPreferredWidth: -1
14 property bool vertical: false ///< true: label above the combo box
15
16 columns: vertical ? 1 : 2
17 columnSpacing: ScreenTools.defaultFontPixelWidth * 2
18 rowSpacing: 0
19
20 signal activated(int index)
21
22 QGCLabel {
23 id: label
24 Layout.fillWidth: !vertical
25 Layout.minimumWidth: implicitWidth
26 }
27
28 FactComboBox {
29 id: _comboBox
30 Layout.preferredWidth: comboBoxPreferredWidth
31 sizeToContents: true
32
33 onActivated: (index) => { parent.activated(index) }
34 }
35}