Debian Codegraph @

tests/examples/qt6/qmlrendersrc/main.qml

raw
1 // SPDX-License-Identifier: BSD-2-Clause
2 //
3 // Copyright (C) 2025, Matthew Waters <[email protected]>
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are met:
7 //
8 // a) Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer.
10 //
11 // b) Redistributions in binary form must reproduce the above copyright
12 // notice, this list of conditions and the following disclaimer in
13 // the documentation and/or other materials provided with the distribution.
14 //
15 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
17 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
25 // THE POSSIBILITY OF SUCH DAMAGE.
26
27 import QtQuick 6.0
28 import QtQuick.Controls 6.0
29 import QtQuick.Dialogs 6.0
30 import QtQuick.Window 6.0
31
32 Rectangle {
33 /* render upside down for GStreamer */
34 transform: Scale { origin.x : 0; origin.y : height / 2.; yScale : -1 }
35 objectName: "root"
36 id: root
37 width: 640
38 height: 480
39 color: "black"
40
41 Text {
42 id: rotatingText
43 anchors.centerIn: parent
44 text: "qml6glrendersrc text"
45 font.pointSize: 20
46 color: "yellow"
47 style: Text.Outline
48 styleColor: "blue"
49
50 Timer {
51 interval: 3000
52 onTriggered: rotater.running = !rotater.running
53 repeat: true
54 running: true
55 }
56
57 RotationAnimator {
58 id: rotater
59 target: rotatingText;
60 from: 0;
61 to: 360;
62 duration: 5000
63 running: true
64 loops: Animation.Infinite
65 }
66 }
67 }