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

TapHandler PassiveGrab prohibits event propagation to Button click

    XMLWordPrintable

Details

    • Windows

    Description

      Observation
      TapHandler with Passive Grab does not trigger QtQuick Controls 2 Button Click. The TapHandler is wrapped in an item to ensure it's an Item sibling of the Button and both are overlapping.

      Expectation
      Because the TapHandler creates only a passive grab, I've expected to get the CLICKED log entry.

      Code

      Item {
         anchors.fill: parent
      
         Button {
            objectName: "button"
            anchors.fill: parent
            onClicked: () => console.log("CLICKED");
         }
      
         Item {
            objectName: "handlerContainer"
            anchors.fill: parent
      
            TapHandler {
               objectName: "tapHandler"
               gesturePolicy: TapHandler.DragThreshold
               onTapped: () => console.log("TAP");
            }
         }
      }
      
      qt.quick.handler.dispatch: "tapHandler" checking device type QFlags<QInputDevice::DeviceType>(AllDevices) pointer type QFlags<QPointingDevice::PointerType>(AllPointerTypes) modifiers QFlags<Qt::KeyboardModifier>(KeyboardModifierMask)
      qt.quick.handler.dispatch: QQuickTapHandler "tapHandler" on QQuickItem "handlerContainer" WANTS QMouseEvent(MouseButtonPress LeftButton pos=10,388 scn=10,388 gbl=-1149,495 dev=QPointingDevice("core pointer" Mouse id=1))
      qt.quick.handler.tap: "tapHandler" pressed false -> true  QEventPoint(id=0 ts=15269 pos=10,388 scn=10,388 gbl=-1149,495 Pressed vel=2.14629,-14.8594 press=10,388 last=10,388 ? 0,0) gp QQuickTapHandler::DragThreshold
      qt.quick.handler.grab: QQuickTapHandler(0x22bb389c070, name = "tapHandler") QEventPoint(id=0 ts=15269 pos=10,388 scn=10,388 gbl=-1149,495 Pressed vel=2.14629,-14.8594 press=10,388 last=10,388 ? 0,0) true via QQuickDeliveryAgent(root=QQuickRootItem)
      qt.quick.handler.grab: QEventPoint(id=0 ts=15269 pos=10,388 scn=10,388 gbl=-1149,495 Pressed vel=2.14629,-14.8594 press=10,388 last=10,388 ? 0,0) QPointingDevice::GrabPassive QQuickTapHandler(0x22bb389c070, name = "tapHandler")
      qt.quick.mouse: QQuickDeliveryAgent(root=QQuickRootItem) QMouseEvent(MouseButtonRelease LeftButton pos=10,388 scn=10,388 gbl=-1149,495 dev=QPointingDevice("core pointer" Mouse id=1))
      qt.quick.handler.dispatch: "tapHandler" checking device type QFlags<QInputDevice::DeviceType>(AllDevices) pointer type QFlags<QPointingDevice::PointerType>(AllPointerTypes) modifiers QFlags<Qt::KeyboardModifier>(KeyboardModifierMask)
      qt.quick.handler.dispatch: QQuickTapHandler "tapHandler" on QQuickItem "handlerContainer" WANTS QMouseEvent(MouseButtonRelease LeftButton pos=10,388 scn=10,388 gbl=-1149,495 dev=QPointingDevice("core pointer" Mouse id=1))
      qt.quick.handler.tap: "tapHandler" pressed true -> false  QEventPoint(id=0 ts=15355 pos=10,388 scn=10,388 gbl=-1149,495 Released vel=0.643887,-4.45783 press=10,388 last=10,388 ? 0,0) gp QQuickTapHandler::DragThreshold
      qt.quick.handler.tap: "tapHandler" tapped 1 times
      
      qml: TAP
      
      qt.quick.handler.grab: QEventPoint(id=0 ts=15355 pos=10,388 scn=10,388 gbl=-1149,495 Released vel=0.643887,-4.45783 press=10,388 last=10,388 ? 0,0) QPointingDevice::UngrabPassive QQuickTapHandler(0x22bb389c070, name = "tapHandler")

      Notes

      • Enable "false" on the TapHandler makes the Button react again
      • QTBUG-96030 describes the same issue with MouseArea

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

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

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes