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