All the QTest::mouseX() functions have an optional delay argument: https://doc.qt.io/qt-6/qtest.html#mousePress but we don't have it for touch events. Sometimes we need to delay a touch press to avoid double-click detection, for example, or to control the velocity calculation by virtually slowing down the touch moves. This is best done by controlling the event timestamps rather than via actual QTest::qWait() delays: for the sake of speed, and also because it seems like when the variant of QWindowSystemInterface::handleTouchEvent() that does not take a timestamp uses
qWait() doesn't always affect it.
One minor goal for Qt 6 was that QWindowSystemInterface event-handling functions should all take timestamps. handleTouchEvent() still has both variants (one taking a timestamp, and one not). It would be best to eventually remove the one that uses that elapsed() time. But then QTest functions need to always provide timestamps.
|For Gerrit Dashboard: QTBUG-95421|
|362286,9||Add keyboard modifiers and delay to QTest::touchEvent()||dev||qt/qtbase||Status: NEW||0||0|