46665cb4c8dfebe0b23bb3a44bb861c058063dae
[profile/ivi/qtdeclarative.git] / tests / auto / qtquick2 / qdeclarativestates / data / parentChange3.qml
1 import QtQuick 2.0
2
3 Rectangle {
4     width: 400; height: 400
5     Item {
6         scale: .5
7         rotation: 15
8         transformOrigin: "Center"
9         x: 10; y: 10
10         Rectangle {
11             id: myRect
12             objectName: "MyRect"
13             x: 5
14             width: 100; height: 100
15             transformOrigin: "BottomLeft"
16             color: "red"
17         }
18     }
19     MouseArea {
20         id: clickable
21         anchors.fill: parent
22     }
23
24     Item {
25         x: 200; y: 200
26         rotation: 52;
27         scale: 2
28         Item {
29             id: newParent
30             x: 100; y: 100
31         }
32     }
33
34     states: State {
35         name: "reparented"
36         when: clickable.pressed
37         ParentChange {
38             target: myRect
39             parent: newParent
40         }
41     }
42 }