summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qmlvisual/qdeclarativemousearea/nested.qml
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-11-24 04:28:18 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-11-24 04:28:18 (GMT)
commit810e21d9e404aa2fcb602cb68bfd892387b234e7 (patch)
tree00fc61dbeb33b522b0fc5e3e56ddf87a30582e7a /tests/auto/declarative/qmlvisual/qdeclarativemousearea/nested.qml
parente3da9407ad85a65abce72f8a32230ec4f2f95369 (diff)
downloadQt-810e21d9e404aa2fcb602cb68bfd892387b234e7.zip
Qt-810e21d9e404aa2fcb602cb68bfd892387b234e7.tar.gz
Qt-810e21d9e404aa2fcb602cb68bfd892387b234e7.tar.bz2
Flickable and MouseArea were too eager to take/keep mouse grab.
This meant that they would sometimes act upon a drag immediately, rather than waiting for a nested area to take the grab. This resulted in a short jump before future events were handled by the nested item. Task-number: QTBUG-15568 Reviewed-by: Bea Lam
Diffstat (limited to 'tests/auto/declarative/qmlvisual/qdeclarativemousearea/nested.qml')
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/nested.qml62
1 files changed, 62 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/nested.qml b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/nested.qml
new file mode 100644
index 0000000..b2d88d2
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/nested.qml
@@ -0,0 +1,62 @@
+import QtQuick 1.0
+
+/*
+ Test nested MouseArea with different drag axes.
+*/
+
+Rectangle{
+ width:400
+ height:360
+ color: "white"
+ Flickable {
+ anchors.fill: parent
+ contentWidth: 600
+ contentHeight: 600
+ Rectangle{
+ id: draggable
+ width:200; height:200; color: "lightsteelblue"
+ opacity: ma1.drag.active ? 0.5 : 1.0
+ y:20
+ MouseArea{
+ id: ma1
+ objectName: "one"
+ anchors.fill: parent
+ drag.target: draggable
+ drag.axis: "XandYAxis"
+ drag.filterChildren: true
+ drag.minimumX: 0
+ drag.maximumX: 200
+ drag.minimumY: 20
+ drag.maximumY: 220
+ Rectangle{
+ id: draggable_inner
+ width:40; height:40; color: "red"
+ y:20
+ MouseArea{
+ objectName: "two"
+ anchors.fill: parent
+ drag.target: draggable_inner
+ drag.axis: "XAxis"
+ drag.minimumX: 0
+ drag.maximumX: 360
+ }
+ }
+ }
+ }
+ Rectangle{
+ id: draggable3
+ width:40; height:40; color: "green"
+ opacity: ma3.drag.active ? 0.5 : 1.0
+ y:210
+ MouseArea{
+ id: ma3
+ objectName: "three"
+ anchors.fill: parent
+ drag.target: draggable3
+ drag.axis: "XAxis"
+ drag.minimumX: 0
+ drag.maximumX: 360
+ }
+ }
+ }
+}