equal
deleted
inserted
replaced
|
1 import Qt 4.7 |
|
2 Rectangle { |
|
3 id: whiteRect |
|
4 width: 200 |
|
5 height: 200 |
|
6 color: "white" |
|
7 Rectangle { |
|
8 id: blackRect |
|
9 objectName: "blackrect" |
|
10 color: "black" |
|
11 y: 50 |
|
12 x: 50 |
|
13 width: 100 |
|
14 height: 100 |
|
15 opacity: (whiteRect.width-blackRect.x+whiteRect.height-blackRect.y-199)/200 |
|
16 Text { text: blackRect.opacity} |
|
17 MouseArea { |
|
18 objectName: "mouseregion" |
|
19 anchors.fill: parent |
|
20 drag.target: blackRect |
|
21 drag.axis: Drag.XandYAxis |
|
22 drag.minimumX: 0 |
|
23 drag.maximumX: whiteRect.width-blackRect.width |
|
24 drag.minimumY: 0 |
|
25 drag.maximumY: whiteRect.height-blackRect.height |
|
26 } |
|
27 } |
|
28 } |