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

QTouchEvents are missing modifiers on most platforms

    XMLWordPrintable

Details

    • e011c9c3b8f6754c5478f8c1e641c761b7c77c6d

    Description

      Discovered this while trying to prototype a UI which requires a modifier key to be held with one hand while manipulating the touchscreen with the other. It should be possible, and we plan to support it via QML API with PointerHandlers:

      https://codereview.qt-project.org/#/c/190310/

      A QTouchEvent is a QInputEvent, so it has a modifiers property by inheritance; and we should not leave such properties unset when it's trivial to set them properly.

      $ cd qtbase/src/plugins/platforms
      $ git grep handleTouchEvent
      android/androidjniinput.cpp:        QWindowSystemInterface::handleTouchEvent(window, touchDevice, m_touchPoints);
      cocoa/qnsview.mm:    QWindowSystemInterface::handleTouchEvent(m_platformWindow->window(), timestamp * 1000, touchDevice, points);
      cocoa/qnsview.mm:    QWindowSystemInterface::handleTouchEvent(m_platformWindow->window(), timestamp * 1000, touchDevice, points);
      cocoa/qnsview.mm:    QWindowSystemInterface::handleTouchEvent(m_platformWindow->window(), timestamp * 1000, touchDevice, points);
      cocoa/qnsview.mm:    QWindowSystemInterface::handleTouchEvent(m_platformWindow->window(), timestamp * 1000, touchDevice, points);
      ios/quiview.mm:    QWindowSystemInterface::handleTouchEvent<QWindowSystemInterface::SynchronousDelivery>(m_qioswindow->window(), timeStamp, iosIntegration->touchDevice(), m_activeTouches.values());
      mirclient/qmirclientinput.cpp:    QWindowSystemInterface::handleTouchEvent(window->window(), timestamp,
      qnx/qqnxscreeneventhandler.cpp:        handleTouchEvent(event, qnxType);
      qnx/qqnxscreeneventhandler.cpp:void QQnxScreenEventHandler::handleTouchEvent(screen_event_t event, int qnxType)
      qnx/qqnxscreeneventhandler.cpp:            QWindowSystemInterface::handleTouchEvent(w, m_touchDevice, pointList);
      qnx/qqnxscreeneventhandler.h:    void handleTouchEvent(screen_event_t event, int qnxType);
      windows/qwindowsmousehandler.cpp:    QWindowSystemInterface::handleTouchEvent(window,
      winrt/qwinrtscreen.cpp:        QWindowSystemInterface::handleTouchEvent(targetWindow, d->touchDevice, d->touchPoints.values(), mods);
      xcb/qxcbconnection_xi2.cpp:    QWindowSystemInterface::handleTouchEvent(platformWindow->window(), xiDeviceEvent->time, dev->qtTouchDevice, dev->touchPoints.values());
      

      So it seems WinRT is the only platform which currently does this. QWindowSystemInterface::handleTouchEvent() has a default value for the last parameter, the modifiers. And so we can say this is a platform inconsistency, which makes the bug sufficiently high priority to start fixing it in 5.9, IMO.

      Maybe when we have fixed all the platforms, we should remove the parameter default value in 5.10, to enforce that plugins will always pass the modifiers explicitly.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-60389
          # Subject Branch Project Status CR V

          Activity

            People

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

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There is 1 open Gerrit change