summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativemousearea/data
diff options
context:
space:
mode:
authorLeonardo Sobral Cunha <leo.cunha@nokia.com>2010-04-20 00:56:04 (GMT)
committerLeonardo Sobral Cunha <leo.cunha@nokia.com>2010-04-20 01:11:13 (GMT)
commitfca7ddd5522f1462192b6c2b4b9e9e5a0f8449d9 (patch)
tree61c30b5562b53fa5997c05abfb66c248e5082482 /tests/auto/declarative/qdeclarativemousearea/data
parent8efa7be3fd66119753730be643d0882afe329348 (diff)
downloadQt-fca7ddd5522f1462192b6c2b4b9e9e5a0f8449d9.zip
Qt-fca7ddd5522f1462192b6c2b4b9e9e5a0f8449d9.tar.gz
Qt-fca7ddd5522f1462192b6c2b4b9e9e5a0f8449d9.tar.bz2
Add drag.active property to MouseArea in qml
The drag.active property specifies if the target item is being dragged. Task-number: QTBUG-9833 Reviewed-by: Martin Jones
Diffstat (limited to 'tests/auto/declarative/qdeclarativemousearea/data')
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/data/dragging.qml28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/dragging.qml b/tests/auto/declarative/qdeclarativemousearea/data/dragging.qml
new file mode 100644
index 0000000..a28f049
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemousearea/data/dragging.qml
@@ -0,0 +1,28 @@
+import Qt 4.7
+Rectangle {
+ id: whiteRect
+ width: 200
+ height: 200
+ color: "white"
+ Rectangle {
+ id: blackRect
+ objectName: "blackrect"
+ color: "black"
+ y: 50
+ x: 50
+ width: 100
+ height: 100
+ opacity: (whiteRect.width-blackRect.x+whiteRect.height-blackRect.y-199)/200
+ Text { text: blackRect.opacity}
+ MouseArea {
+ objectName: "mouseregion"
+ anchors.fill: parent
+ drag.target: blackRect
+ drag.axis: Drag.XandYAxis
+ drag.minimumX: 0
+ drag.maximumX: whiteRect.width-blackRect.width
+ drag.minimumY: 0
+ drag.maximumY: whiteRect.height-blackRect.height
+ }
+ }
+ }