| changeset 30 | 5dc02b23752f |
| 29:b72c6db6890b | 30:5dc02b23752f |
|---|---|
1 import Qt 4.7 |
|
2 |
|
3 Rectangle { |
|
4 width: 400; height: 400 |
|
5 Rectangle { |
|
6 id: myRect |
|
7 objectName: "MyRect" |
|
8 x: 5; y: 5 |
|
9 width: 100; height: 100 |
|
10 color: "red" |
|
11 } |
|
12 MouseArea { |
|
13 id: clickable |
|
14 anchors.fill: parent |
|
15 } |
|
16 |
|
17 Item { |
|
18 id: newParent |
|
19 transform: Scale { xScale: .5; yScale: .7} |
|
20 } |
|
21 |
|
22 states: State { |
|
23 name: "reparented" |
|
24 when: clickable.pressed |
|
25 ParentChange { |
|
26 target: myRect |
|
27 parent: newParent |
|
28 } |
|
29 } |
|
30 } |