aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickmousearea/data
diff options
context:
space:
mode:
authorAlan Alpert <aalpert@blackberry.com>2013-11-04 13:29:12 -0800
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-05 19:00:03 +0100
commit41f447272f9c7e1c632770bb952f2515494edce0 (patch)
tree0915f52a290bea67dd45c90bb69c41f15f80fc08 /tests/auto/quick/qquickmousearea/data
parent025365f1dc6dc9c3244a125882433e55b57fa672 (diff)
Don't propagate mouse events to disabled MouseAreas
Task-number: QTBUG-34368 Change-Id: I28d4f57e51300f12a7bab5d215933762102f3916 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'tests/auto/quick/qquickmousearea/data')
-rw-r--r--tests/auto/quick/qquickmousearea/data/qtbug34368.qml38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickmousearea/data/qtbug34368.qml b/tests/auto/quick/qquickmousearea/data/qtbug34368.qml
new file mode 100644
index 0000000000..42d8ddd3b6
--- /dev/null
+++ b/tests/auto/quick/qquickmousearea/data/qtbug34368.qml
@@ -0,0 +1,38 @@
+import QtQuick 2.2
+
+Rectangle {
+ id: root
+ color: "green"
+ width: 200
+ height: 200
+ property int clicksEnabled: 0
+ property int clicksDisabled: 0
+ property bool disableLower: false
+ MouseArea {
+ anchors.fill: parent
+ propagateComposedEvents: true
+ z: 1
+ onClicked: {
+ mouse.accepted = false;
+ clicksEnabled += 1;
+ //console.log("Upper click");
+ }
+ }
+ MouseArea {
+ anchors.fill: parent
+ propagateComposedEvents: true
+ z: 0
+ enabled: !disableLower
+ onClicked: {
+ mouse.accepted = false;
+ clicksDisabled += 1;
+ //console.log("Lower click");
+ }
+ }
+ Text {
+ anchors.fill: parent
+ text: "A: " + clicksEnabled + " B:" + clicksDisabled
+ focus: true
+ Keys.onSpacePressed: root.disableLower = !root.disableLower;
+ }
+}