QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
NoVideoPlaceholder.qml
Go to the documentation of this file.
1import QtQuick
2
3import QGroundControl
4import QGroundControl.Controls
5
6// What a video view shows without video: why it has none, over a background picture.
7Image {
8 id: root
9
10 /// Small text, for a picture-in-picture view.
11 property bool useSmallFont: true
12 /// The manager whose reason for having no video is shown.
13 property VideoManager videoManager: QGroundControl.videoManager
14
15 readonly property string _reasonText: {
16 switch (root.videoManager.noVideoReason) {
17 case VideoManager.NoVideoReason.DisabledWhileDisarmed:
18 return qsTr("VIDEO DISABLED WHILE DISARMED")
19 case VideoManager.NoVideoReason.Stopped:
20 return qsTr("VIDEO STOPPED")
21 default:
22 return qsTr("WAITING FOR VIDEO")
23 }
24 }
25
26 source: "/res/NoVideoBackground.jpg"
27 sourceSize: Qt.size(root.width, root.height)
28 fillMode: Image.PreserveAspectCrop
29
30 VideoStatusLabel {
31 anchors.centerIn: parent
32 useSmallFont: root.useSmallFont
33 maximumWidth: root.width
34 text: root._reasonText
35 }
36}