aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
authorjuhvu <qt-info@nokia.com>2011-09-21 13:04:11 +1000
committerQt by Nokia <qt-info@nokia.com>2011-09-22 05:03:32 +0200
commit7100a74def3a82bc52c93b800cec973bf312b1b3 (patch)
treecc24a9a8dc789e3640beb7f2f48316d0455afb40 /src/imports
parent7ecce2cc0e33bc6b1aa052163f9d6c1365b93b27 (diff)
Wheel event support in qmltestlib + few fixes.
added unit test and orientaion support for mouseWheel Change-Id: I9c26dc762281bc32965769c151414ac0e177ad0f Reviewed-on: http://codereview.qt-project.org/5272 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Juha Vuolle <juha.vuolle@nokia.com> Reviewed-by: Charles Yin <charles.yin@nokia.com>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/testlib/TestCase.qml24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml
index ed8bf55d6b..020f934aac 100644
--- a/src/imports/testlib/TestCase.qml
+++ b/src/imports/testlib/TestCase.qml
@@ -435,13 +435,31 @@ Item {
qtest_fail("window not shown", 2)
}
- function mouseMove(item, x, y, delay) {
+ function mouseMove(item, x, y, delay, buttons) {
if (delay == undefined)
delay = -1
- if (!qtest_events.mouseMove(item, x, y, delay))
+ if (buttons == undefined)
+ buttons = Qt.NoButton
+ if (!qtest_events.mouseMove(item, x, y, delay, buttons))
qtest_fail("window not shown", 2)
}
+ function mouseWheel(item, x, y, delta, buttons, modifiers, delay, orientation) {
+ if (delay == undefined)
+ delay = -1
+ if (buttons == undefined)
+ buttons = Qt.NoButton
+ if (modifiers === undefined)
+ modifiers = Qt.NoModifier
+ if (delta == undefined)
+ delta = 0
+ if (orientation == undefined)
+ orientation = Qt.Vertical
+ if (!qtest_events.mouseWheel(item, x, y, buttons, modifiers, delta, delay, orientation))
+ qtest_fail("window not shown", 2)
+ }
+
+
// Functions that can be overridden in subclasses for init/cleanup duties.
function initTestCase() {}
function cleanupTestCase() {}
@@ -692,4 +710,4 @@ Item {
if (when && !completed && !running)
qtest_run()
}
-} \ No newline at end of file
+}