From b9c039b3ac76d20ffe2d05259d5406b7c1bac25d Mon Sep 17 00:00:00 2001 From: Charles Yin Date: Tue, 13 Mar 2012 11:47:59 +1000 Subject: Improve mouseWheel() function Use new angleDela() API and update the documentation. Change-Id: Ie01c979d8c411e81165caedc7e020e39f9d64371 Reviewed-by: Michael Brasser --- src/qmltest/quicktestevent.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/qmltest/quicktestevent.cpp') diff --git a/src/qmltest/quicktestevent.cpp b/src/qmltest/quicktestevent.cpp index 9e401c9392..0bbf097ef4 100644 --- a/src/qmltest/quicktestevent.cpp +++ b/src/qmltest/quicktestevent.cpp @@ -148,7 +148,7 @@ namespace QtQuickTest static void mouseWheel(QWindow* window, QObject* item, Qt::MouseButtons buttons, Qt::KeyboardModifiers stateKey, - QPointF _pos, int delta, int delay = -1, Qt::Orientation orientation = Qt::Vertical) + QPointF _pos, int xDelta, int yDelta, int delay = -1) { QTEST_ASSERT(window); QTEST_ASSERT(item); @@ -166,7 +166,7 @@ namespace QtQuickTest QTEST_ASSERT(stateKey == 0 || stateKey & Qt::KeyboardModifierMask); stateKey &= static_cast(Qt::KeyboardModifierMask); - QWheelEvent we(pos, window->mapToGlobal(pos), delta, buttons, stateKey, orientation); + QWheelEvent we(pos, window->mapToGlobal(pos), QPoint(0, 0), QPoint(xDelta, yDelta), 0, Qt::Vertical, buttons, stateKey); QSpontaneKeyEvent::setSpontaneous(&we); // hmmmm if (!qApp->notify(window, &we)) @@ -190,14 +190,14 @@ bool QuickTestEvent::mousePress bool QuickTestEvent::mouseWheel( QObject *item, qreal x, qreal y, int buttons, - int modifiers, int delta, int delay, int orientation) + int modifiers, int xDelta, int yDelta, int delay) { QWindow *view = eventWindow(); if (!view) return false; QtQuickTest::mouseWheel(view, item, Qt::MouseButtons(buttons), Qt::KeyboardModifiers(modifiers), - QPointF(x, y), delta, delay, Qt::Orientation(orientation)); + QPointF(x, y), xDelta, yDelta, delay); return true; } -- cgit v1.2.3