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

Touch event handling in custom QQuickItem

    XMLWordPrintable

Details

    • Linux/Wayland, Linux/X11

    Description

      Reproducer attached. The goal is to have the custom QQuickItem capture touch events, iterate and log everything it captures. Basically what a MultiPointTouchArea is perfectly capable of, but the original reporter would like to use this custom QQuickItem.

      And some problems observed when the button is tapped on:
      1. Tap it with only 1 finger, then only Pressed event is logged, e.g.

      # of points: 1
      Point # 0 id 22
      QEventPoint::Pressed : 0 QEventPoint::Pressed
      

      The Release event is missing.
      2. Tap it with 2 fingers, the result can be various. Since it is very hard to land both fingers at the same timing, then you may get 1 Pressed + 2 Release or 2 Pressed + 1 Release. This is the log of the latter:

      # of points: 1
      Point # 0 id 23
      QEventPoint::Pressed : 0 QEventPoint::Pressed
      # of points: 2
      Point # 0 id 24
      QEventPoint::Pressed : 0 QEventPoint::Pressed
      Point # 1 id 23
      default
      # of points: 2
      Point # 0 id 24
      default
      # of points: 1
      Point # 0 id 24
      QEventPoint::Released : 0 QEventPoint::Released
      

      Touch point 23 is pressed but not released.

      Either case, it is different from what, e.g. libinput debug-events, reports. The number of Pressed event should equal the number of Release event as well as the number of taps. For example, this is what libinput shows for 1 tap:

       event6   TOUCH_DOWN              +15.877s	0 (0) 63.50/45.72 (225.18/99.45mm)
       event6   TOUCH_FRAME             +15.877s	
       event6   TOUCH_UP                +15.907s	0 (0)
       event6   TOUCH_FRAME             +15.907s
      

      You can clearly see 1 DOWN + 1 UP and that is consistent and always the case.

      I am not sure if it is because missing logics in custom QQuickItem or there are some disconnections in Qt code. If it's the former, maybe it's better to put some notes in documentation?

      Attachments

        1. QTBUG-136791.zip
          2 kB
          Luqiao Chen
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            srutledg Shawn Rutledge
            luqiaochen Luqiao Chen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes