Debian Codegraph @

tests/auto/qmltest-blacklist/animators/tst_multiwindow.qml

raw
1 /****************************************************************************
2 **
3 ** Copyright (C) 2016 Jolla Ltd, author: <[email protected]>
4 ** Contact: https://www.qt.io/licensing/
5 **
6 ** This file is part of the test suite of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:GPL-EXCEPT$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and The Qt Company. For licensing terms
14 ** and conditions see https://www.qt.io/terms-conditions. For further
15 ** information use the contact form at https://www.qt.io/contact-us.
16 **
17 ** GNU General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU
19 ** General Public License version 3 as published by the Free Software
20 ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
21 ** included in the packaging of this file. Please review the following
22 ** information to ensure the GNU General Public License requirements will
23 ** be met: https://www.gnu.org/licenses/gpl-3.0.html.
24 **
25 ** $QT_END_LICENSE$
26 **
27 ****************************************************************************/
28
29 import QtQuick 2.2
30 import QtTest 1.1
31 import QtQuick.Window 2.0
32
33 Item {
34 id: root;
35 width: 200
36 height: 200
37
38 TestCase {
39 id: testCase
40 name: "animators-mixed"
41 when: countdown == 0
42 function test_endresult() {
43 verify(true, "Just making sure we didn't crash");
44 }
45 }
46
47 property int countdown: 5;
48
49 Window {
50 id: window
51
52 width: 100
53 height: 100
54
55 ShaderEffect {
56 width: 50
57 height: 50
58
59 property real t;
60 UniformAnimator on t { from: 0; to: 1; duration: 1000; loops: Animation.Infinite }
61 RotationAnimator on rotation { from: 0; to: 360; duration: 1000; loops: Animation.Infinite }
62 ScaleAnimator on scale { from: 0.5; to: 1.5; duration: 1000; loops: Animation.Infinite }
63 XAnimator on x { from: 0; to: 50; duration: 1000; loops: Animation.Infinite }
64 YAnimator on y { from: 0; to: 50; duration: 1000; loops: Animation.Infinite }
65 OpacityAnimator on opacity { from: 1; to: 0.5; duration: 1000; loops: Animation.Infinite }
66
67 fragmentShader: "
68 uniform lowp float t;
69 uniform lowp float qt_Opacity;
70 varying highp vec2 qt_TexCoord0;
71 void main() {
72 gl_FragColor = vec4(qt_TexCoord0, t, 1) * qt_Opacity;
73 }
74 "
75 }
76
77 visible: true
78 }
79
80 Timer {
81 interval: 250
82 running: true
83 repeat: true
84 onTriggered: {
85 if (window.visible)
86 --countdown
87 window.visible = !window.visible;
88 }
89 }
90 }