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);
|
QCOMPARE(QGuiApplication::keyboardModifiers(), Qt::ControlModifier);
|
||||||
|
|
||||||
// wheel events
|
// wheel events
|
||||||
QPoint global = window->mapToGlobal(center);
|
|
||||||
QPoint delta(0, 1);
|
QPoint delta(0, 1);
|
||||||
QWindowSystemInterface::handleWheelEvent(window.data(), center, global, delta, delta, Qt::NoModifier);
|
QTest::wheelEvent(window.data(), center, delta, delta, Qt::NoModifier);
|
||||||
QWindowSystemInterface::sendWindowSystemEvents(QEventLoop::AllEvents);
|
|
||||||
QCOMPARE(QGuiApplication::keyboardModifiers(), Qt::NoModifier);
|
QCOMPARE(QGuiApplication::keyboardModifiers(), Qt::NoModifier);
|
||||||
QWindowSystemInterface::handleWheelEvent(window.data(), center, global, delta, delta, Qt::AltModifier);
|
QTest::wheelEvent(window.data(), center, delta, delta, Qt::AltModifier);
|
||||||
QWindowSystemInterface::sendWindowSystemEvents(QEventLoop::AllEvents);
|
|
||||||
QCOMPARE(QGuiApplication::keyboardModifiers(), Qt::AltModifier);
|
QCOMPARE(QGuiApplication::keyboardModifiers(), Qt::AltModifier);
|
||||||
QWindowSystemInterface::handleWheelEvent(window.data(), center, global, delta, delta, Qt::ControlModifier);
|
QTest::wheelEvent(window.data(), center, delta, delta, Qt::ControlModifier);
|
||||||
QWindowSystemInterface::sendWindowSystemEvents(QEventLoop::AllEvents);
|
|
||||||
QCOMPARE(QGuiApplication::keyboardModifiers(), Qt::ControlModifier);
|
QCOMPARE(QGuiApplication::keyboardModifiers(), Qt::ControlModifier);
|
||||||
|
|
||||||
// touch events
|
// touch events
|
||||||
|
Loading…
x
Reference in New Issue
Block a user