Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-95421

need the ability to delay (increment timestamps of) touch events, as with mouse events

XMLWordPrintable

      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

          unsigned long time = QWindowSystemInterfacePrivate::eventTime.elapsed();
      

      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
        # Subject Branch Project Status CR V

            srutledg Shawn Rutledge
            srutledg Shawn Rutledge
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There is 1 open Gerrit change