aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickmousearea/data
diff options
context:
space:
mode:
authorLuis Gabriel Lima <luis.gabriel@openbossa.org>2012-01-05 15:19:26 -0300
committerQt by Nokia <qt-info@nokia.com>2012-03-10 02:28:11 +0100
commitf2e1be963f885a6030136591414cdbda26d50695 (patch)
tree3ff02cedfbf5df61e8459dc6d58afd437b23e87b /tests/auto/quick/qquickmousearea/data
parent78356f6038065227acb2dc898994765f49f07b42 (diff)
Add mouse wheel events handler to MouseArea
This patch was based on the attached patch in QTBUG-7369. It basically exposes the wheel events to MouseArea via the onWheel signal. The current API is based on the new QWheelEvent API introduced by this patch: http://codereview.qt-project.org/#change,12532 Task-number: QTBUG-7369 Change-Id: Id58513715c2d0ae81e3a69e9e1ed400bbae07507 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'tests/auto/quick/qquickmousearea/data')
-rw-r--r--tests/auto/quick/qquickmousearea/data/wheel.qml24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickmousearea/data/wheel.qml b/tests/auto/quick/qquickmousearea/data/wheel.qml
new file mode 100644
index 0000000000..3e0c0c2a48
--- /dev/null
+++ b/tests/auto/quick/qquickmousearea/data/wheel.qml
@@ -0,0 +1,24 @@
+import QtQuick 2.0
+
+Rectangle {
+ id: root
+
+ property var angleDeltaY
+ property real mouseX
+ property real mouseY
+ property bool controlPressed
+
+ width: 400
+ height: 400
+
+ MouseArea {
+ anchors.fill: parent
+
+ onWheel: {
+ root.angleDeltaY = wheel.angleDelta.y;
+ root.mouseX = wheel.x;
+ root.mouseY = wheel.y;
+ root.controlPressed = wheel.modifiers & Qt.ControlModifier;
+ }
+ }
+}