Initial import from the monolithic Qt.
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qdeclarativepincharea / data / pinchproperties.qml
1 import QtQuick 1.1
2 Rectangle {
3     id: whiteRect
4     property variant center
5     property real scale
6     width: 240; height: 320
7     color: "white"
8     Rectangle {
9         id: blackRect
10         objectName: "blackrect"
11         color: "black"
12         y: 50
13         x: 50
14         width: 100
15         height: 100
16         opacity: (whiteRect.width-blackRect.x+whiteRect.height-blackRect.y-199)/200
17         Text { text: blackRect.opacity}
18         PinchArea {
19             id: pincharea
20             objectName: "pincharea"
21             anchors.fill: parent
22             pinch.target: blackRect
23             pinch.dragAxis: Drag.XandYAxis
24             pinch.minimumX: 0
25             pinch.maximumX: whiteRect.width-blackRect.width
26             pinch.minimumY: 0
27             pinch.maximumY: whiteRect.height-blackRect.height
28             pinch.minimumScale: 1.0
29             pinch.maximumScale: 2.0
30             pinch.minimumRotation: 0.0
31             pinch.maximumRotation: 90.0
32             onPinchStarted: {
33                 whiteRect.center = pinch.center
34                 whiteRect.scale = pinch.scale
35             }
36             onPinchUpdated: {
37                 whiteRect.center = pinch.center
38                 whiteRect.scale = pinch.scale
39             }
40             onPinchFinished: {
41                 whiteRect.center = pinch.center
42                 whiteRect.scale = pinch.scale
43             }
44          }
45      }
46  }