QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
UVCCameraFormatComboBox.qml
Go to the documentation of this file.
1import QtQuick
2
3import QGroundControl
4import QGroundControl.Controls
5
6// Picks the USB camera's format from the ones it offers. Auto, or a stored format this camera doesn't offer, lets Qt
7// choose: the highest resolution at 30 fps or more.
8LabelledComboBox {
9 id: root
10
11 readonly property Fact _format: QGroundControl.settingsManager.videoSettings.uvcCameraFormat
12 readonly property list<string> _formats: QGroundControl.videoManager.uvcCamera.formats
13
14 label: root._format.label
15 model: [qsTr("Auto")].concat(root._formats)
16
17 onActivated: (index) => {
18 root._format.rawValue = (index > 0) ? root._formats[index - 1] : ""
19 }
20
21 // Follows the setting and the camera's formats, also after the user picked an entry.
22 Binding {
23 target: root
24 property: "currentIndex"
25 value: root._formats.indexOf(root._format.rawValue) + 1
26 }
27}