summaryrefslogtreecommitdiffstats
path: root/examples/declarative/behaviours/test.qml
blob: a544028da9f4d8683df323b47d5fb1df4bc62c14 (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
<Rect color="lightsteelblue" width="800" height="600" id="Page">
    <MouseRegion anchors.fill="{parent}" onClicked="bluerect.parent = Page; bluerect.x = mouseX;" />

    <MyRect color="green" x="200" y="200" />
    <MyRect color="red" x="400" y="200" />
    <MyRect color="yellow" x="400" y="400" />
    <MyRect color="orange" x="400" y="500" />
    <MyRect color="pink" x="400" y="0" />
    <MyRect color="lightsteelblue" x="100" y="500" />
    <MyRect color="black" x="0" y="200" />
    <MyRect color="white" x="400" y="0" />

    <Rect color="blue" x="0" y="0" width="100" height="100" id="bluerect">
        <x>
            <Behaviour>
                <SequentialAnimation>
                    <NumericAnimation target="{bluerect}" properties="y" from="0" to="10" easing="easeOutBounce(amplitude:30)" duration="250" />
                    <NumericAnimation target="{bluerect}" properties="y" from="10" to="0" easing="easeOutBounce(amplitude:30)" duration="250" />
                </SequentialAnimation>
                <NumericAnimation target="{bluerect}" property="x" duration="500" />
            </Behaviour>
        </x>

        <parent>
            <Behaviour>
                <SequentialAnimation>
                    <NumericAnimation target="{bluerect}" properties="opacity" to="0" duration="150" />
                    <SetPropertyAction target="{bluerect}" property="parent" />
                    <NumericAnimation target="{bluerect}" properties="opacity" to="1" duration="150"/>
                </SequentialAnimation>
            </Behaviour>
        </parent>
        
    </Rect>


</Rect>