equal
deleted
inserted
replaced
|
1 import Qt 4.7 |
|
2 |
|
3 Rectangle { |
|
4 width: 400; height: 400 |
|
5 Item { |
|
6 x: 10; y: 10 |
|
7 Rectangle { |
|
8 id: myRect |
|
9 objectName: "MyRect" |
|
10 x: 5 |
|
11 width: 100; height: 100 |
|
12 color: "red" |
|
13 } |
|
14 } |
|
15 MouseArea { |
|
16 id: clickable |
|
17 anchors.fill: parent |
|
18 } |
|
19 |
|
20 Item { |
|
21 x: -100; y: -50 |
|
22 Item { |
|
23 id: newParent |
|
24 objectName: "NewParent" |
|
25 x: 248; y: 360 |
|
26 } |
|
27 } |
|
28 |
|
29 states: State { |
|
30 name: "reparented" |
|
31 when: clickable.pressed |
|
32 ParentChange { |
|
33 target: myRect |
|
34 parent: newParent |
|
35 } |
|
36 } |
|
37 } |