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

Unable to prevent touch events propagation through an input blocking overlay to a ListView below that consists of TapHandlers in its delegates

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.7.3, 6.8.3
    • Reproduced on:
      - ARM64, ILITEK display, Yocto Linux, Qt 6.7.3, both wayland and eglfs.
      - Windows 11 laptop, touch screen display, Qt 6.8.3
    • Linux/Wayland, Linux/Yocto, Linux/Other display system, Windows

    Description

      I want to create an overlay layer above a Flickable (e.g. ListView) that - under certain conditions - prevent all touch events from being propagated to a Flickable below it. I want this to work like a modal popup that blocks any inputs from being propagated to the background items (btw. modal popups do not work in such a case as well).

      However, if a Flickable / ListView has delegates consisting of any kind of input handlers, incl. TapHandler, MouseArea, Button, etc., the input blocking mechanism stops working. Most of the events are still handled by the InputBlocker and filtered out, but some single events are still being propagated to the delegates and then stolen by a flickable, which leads to dragging. Setting MouseArea's `preventStealing` to true solves the issue, but TapHandlers and Buttons do not offer such a property.

      If I remove the handlers from the delegates, the input blocking works as expected.

      Please note, that in order to reproduce the issue you need to try to scroll the ListView below the InputBlocker with multiple fingers (it's related to the multitouch) or even with your whole hand.

      I include the Main.qml file with:

      • a ListView where the delegates consist of Buttons 
      • InputBlocker that covers the ListView completely.

      and the InputBlocker.h file where a simple InputBlocker is defined. However, this bug can also be reproduced by replacing the custom InputBlocker with e.g. MultiPointTouchArea.

      It's enough to comment out the Buttons from the ListView's delegates in order to test that the inputs are properly filtered out in that case.

      Attachments

        1. InputBlocker.h
          1.0 kB
        2. Main.qml
          0.5 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            piotrtanski Piotr Tański
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes