| branch | GCC_SURGE |
| changeset 31 | 5daf16870df6 |
| parent 30 | 5dc02b23752f |
| 27:93b982ccede2 | 31:5daf16870df6 |
|---|---|
1 import Qt 4.7 |
|
2 Rectangle { |
|
3 width: 400 |
|
4 height: 400 |
|
5 property real basex : 0 |
|
6 property real movedx: 200 |
|
7 Rectangle { |
|
8 id: rect |
|
9 objectName: "MyRect" |
|
10 width: 100; height: 100; color: "green" |
|
11 x: basex |
|
12 Behavior on x { NumberAnimation { duration: 800; } } |
|
13 } |
|
14 MouseArea { |
|
15 id: clicker |
|
16 anchors.fill: parent |
|
17 } |
|
18 states: State { |
|
19 name: "moved" |
|
20 when: clicker.pressed |
|
21 PropertyChanges { |
|
22 target: rect |
|
23 x: movedx |
|
24 } |
|
25 } |
|
26 } |