summaryrefslogtreecommitdiffstats
path: root/tests/test.qml
blob: 7abef56f4093e64e882de882e3d3768d4075fddd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import QtQuick 2.0

Rectangle {
    width: 800
    height: 480
    color: "white"

    Flickable {
        anchors.fill: parent
        contentWidth: 1000
        contentHeight: 700

        MouseArea {
            width: 100; height: 100
            onClicked: print("Hello, you've clicked on a little MouseArea on a Flickable!");
        }

        Item {
            width: 100; height: 100

            Rectangle {
                color: "green"
                anchors.fill: parent
            }
            NumberAnimation on x { from: 0; to: 700; duration: 500; loops: -1 }
        }

        Rectangle {
            radius: 15
            y: 100
            width: 100
            height: 100
            color: "blue"
            border.width:2 
            NumberAnimation on x { from: 0; to: 700; duration: 3000; loops: -1 }
        }

        Image {
            y: 300
            width: 100
            height: 50
            fillMode: Image.Tile
            source: "face-smile.png"
            NumberAnimation on width { from: 100; to: 800; duration: 4000; loops: -1 }
            NumberAnimation on height { from: 50; to: 200; duration: 4000; loops: -1 }
                NumberAnimation on opacity { from: 0; to: 1; duration: 500; loops: -1 }
        }


        Repeater {
            model: 10
            Rectangle {
                y: 500
                x: index * 110
                color: "blue"
                width: 100; height: 90
                border.width: 2
                border.color: "pink"
                radius: 5
            }
        }

        Item {
            width: 150;
            height: 100
            clip: true
            Row {
                NumberAnimation on opacity { from: 0; to: 1; duration: 500; loops: -1 }
                y: 200
                width: 800
                Rectangle {
                    NumberAnimation on scale { from: 1; to: 2; duration: 2000; loops: -1 }
                    NumberAnimation on rotation { from: 0; to: 10; duration: 2000; loops: -1 }
                    width: 100; height: 100;
                    color: "pink"
                    radius: 2
                    border.color: "black"
                    border.width: 1
                }
                Rectangle {
                    width: 100; height: 100;
                    color: "orange"
                }
                Rectangle {
                    width: 100; height: 100;
                    color: "purple"
                }
            }
        }
    }

    Text {
        id: mytext
        text: "QML SceneGraph Test - How do you like dem apples?"
        NumberAnimation on width { from: 0; to: 700; duration: 1000; loops: -1 }
    }
}