Debian Codegraph @

tests/examples/qt6/qmloverlay/overlay.qml

raw
1 import QtQuick 6.0
2
3 import org.freedesktop.gstreamer.Qt6GLVideoItem 1.0
4
5 Item {
6 /* render upside down for GStreamer */
7 transform: Scale { origin.x : 0; origin.y : height / 2.; yScale : -1 }
8
9 GstGLQt6VideoItem {
10 id: video
11 objectName: "inputVideoItem"
12 anchors.centerIn: parent
13 width: parent.width
14 height: parent.height
15 }
16
17 Text {
18 id: rotatingText
19 anchors.centerIn: parent
20 text: "Qt Quick\nrendered to\na texture"
21 font.pointSize: 20
22 color: "black"
23 style: Text.Outline
24 styleColor: "white"
25
26 RotationAnimator {
27 target: rotatingText;
28 from: 0;
29 to: 360;
30 duration: 5000
31 running: true
32 loops: Animation.Infinite
33 }
34 }
35
36 Text {
37 property int elapsedTime: 0
38
39 id: time
40 anchors.top: rotatingText.bottom
41 anchors.horizontalCenter: rotatingText.horizontalCenter
42 font.pointSize: 12
43 style: Text.Outline
44 styleColor: "black"
45 color: "white"
46
47 Timer {
48 interval: 1000
49 running: true
50 repeat: true
51 onTriggered: {
52 parent.elapsedTime += interval / 1000
53 parent.text = "overlay: " + parent.elapsedTime.toString() + " seconds"
54 }
55 }
56 }
57 }