QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
UVCControlSlider.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Layouts
3
4import QGroundControl
5import QGroundControl.Controls
6
7// A USB camera setting set with a slider, over the range the camera offers, with the value shown beside it.
8RowLayout {
9 id: root
10
11 required property Fact setting
12 property real from: root.setting.min
13 property real to: root.setting.max
14 property real stepSize: 0.1
15 property string valueText: root.setting.valueString + (root.setting.units ? " " + root.setting.units : "")
16
17 spacing: ScreenTools.defaultFontPixelWidth * 2
18
19 QGCLabel {
20 text: root.setting.label
21 Layout.fillWidth: true
22 }
23
24 QGCSlider {
25 id: slider
26
27 from: root.from
28 to: root.to
29 stepSize: root.stepSize
30 Layout.preferredWidth: ScreenTools.defaultFontPixelWidth * 20
31 onMoved: root.setting.rawValue = slider.value
32
33 Binding on value {
34 value: root.setting.rawValue
35 when: !slider.pressed
36 restoreMode: Binding.RestoreNone
37 }
38 }
39
40 QGCLabel {
41 text: root.valueText
42 horizontalAlignment: Text.AlignRight
43 Layout.minimumWidth: ScreenTools.defaultFontPixelWidth * 7
44 }
45}