Replace uses of QWheelEvent with newly added QTest::wheelEvent
Change-Id: I83fdc4cc3328fd178b054bef3113bf5df75d71cf Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This commit is contained in:
parent
173adf4fbf
commit
f413229184
@ -460,16 +460,12 @@ void tst_QGuiApplication::keyboardModifiers()
|
||||
QCOMPARE(QGuiApplication::keyboardModifiers(), Qt::ControlModifier);
|
||||
|
||||
// wheel events
|
||||
QPoint global = window->mapToGlobal(center);
|
||||
QPoint delta(0, 1);
|
||||
QWindowSystemInterface::handleWheelEvent(window.data(), center, global, delta, delta, Qt::NoModifier);
|
||||
QWindowSystemInterface::sendWindowSystemEvents(QEventLoop::AllEvents);
|
||||
QTest::wheelEvent(window.data(), center, delta, delta, Qt::NoModifier);
|
||||
QCOMPARE(QGuiApplication::keyboardModifiers(), Qt::NoModifier);
|
||||
QWindowSystemInterface::handleWheelEvent(window.data(), center, global, delta, delta, Qt::AltModifier);
|
||||
QWindowSystemInterface::sendWindowSystemEvents(QEventLoop::AllEvents);
|
||||
QTest::wheelEvent(window.data(), center, delta, delta, Qt::AltModifier);
|
||||
QCOMPARE(QGuiApplication::keyboardModifiers(), Qt::AltModifier);
|
||||
QWindowSystemInterface::handleWheelEvent(window.data(), center, global, delta, delta, Qt::ControlModifier);
|
||||
QWindowSystemInterface::sendWindowSystemEvents(QEventLoop::AllEvents);
|
||||
QTest::wheelEvent(window.data(), center, delta, delta, Qt::ControlModifier);
|
||||
QCOMPARE(QGuiApplication::keyboardModifiers(), Qt::ControlModifier);
|
||||
|
||||
// touch events
|
||||
|
Loading…
x
Reference in New Issue
Block a user