Initial import from the monolithic Qt.
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qdeclarativemousearea / data / updateMousePosOnResize.qml
1 import QtQuick 1.0
2
3 Rectangle {
4     color: "#ffffff"
5     width: 320; height: 240
6     Rectangle {
7         id: brother
8         objectName: "brother"
9         color: "lightgreen"
10         x: 200; y: 100
11         width: 120; height: 120
12     }
13     MouseArea {
14         id: mouseRegion
15         objectName: "mouseregion"
16
17         property int x1
18         property int y1
19         property int x2
20         property int y2
21         property bool emitPositionChanged: false
22         property bool mouseMatchesPos: true
23
24         anchors.fill: brother
25         onPressed: {
26             if (mouse.x != mouseX || mouse.y != mouseY)
27                 mouseMatchesPos = false
28             x1 = mouseX; y1 = mouseY
29             anchors.fill = parent
30         }
31         onPositionChanged: { emitPositionChanged = true }
32         onMousePositionChanged: {
33             if (mouse.x != mouseX || mouse.y != mouseY)
34                 mouseMatchesPos = false
35             x2 = mouseX; y2 = mouseY
36         }
37     }
38 }