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

TapHandler PassiveGrab prohibits event propagation to MouseArea click

XMLWordPrintable

    • Windows

      Observation
      TapHandler with Passive Grab does not trigger MouseArea Click. The TapHandler is wrapped in an item to ensure it's an Item sibling of the MouseArea 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
      
         MouseArea {
            objectName: "mouseArea"
            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=18,287 scn=18,287 gbl=-1141,394 dev=QPointingDevice("core pointer" Mouse id=1))
      qt.quick.handler.tap: "tapHandler" pressed false -> true  QEventPoint(id=0 ts=5805 pos=18,287 scn=18,287 gbl=-1141,394 Pressed vel=24.0964,-7.98291 press=18,287 last=18,287 ? 0,0) gp QQuickTapHandler::DragThreshold
      qt.quick.handler.grab: QQuickTapHandler(0x163dca07ea0, name = "tapHandler") QEventPoint(id=0 ts=5805 pos=18,287 scn=18,287 gbl=-1141,394 Pressed vel=24.0964,-7.98291 press=18,287 last=18,287 ? 0,0) true via QQuickDeliveryAgent(root=QQuickRootItem)
      qt.quick.handler.grab: QEventPoint(id=0 ts=5805 pos=18,287 scn=18,287 gbl=-1141,394 Pressed vel=24.0964,-7.98291 press=18,287 last=18,287 ? 0,0) QPointingDevice::GrabPassive QQuickTapHandler(0x163dca07ea0, name = "tapHandler")
      qt.quick.mouse: QQuickDeliveryAgent(root=QQuickRootItem) QMouseEvent(MouseButtonRelease LeftButton pos=18,287 scn=18,287 gbl=-1141,394 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=18,287 scn=18,287 gbl=-1141,394 dev=QPointingDevice("core pointer" Mouse id=1))
      qt.quick.handler.tap: "tapHandler" pressed true -> false  QEventPoint(id=0 ts=5884 pos=18,287 scn=18,287 gbl=-1141,394 Released vel=7.22891,-2.39487 press=18,287 last=18,287 ? 0,0) gp QQuickTapHandler::DragThreshold
      qt.quick.handler.tap: "tapHandler" tapped 1 times
      
      qml: TAP
      
      qt.quick.handler.grab: QEventPoint(id=0 ts=5884 pos=18,287 scn=18,287 gbl=-1141,394 Released vel=7.22891,-2.39487 press=18,287 last=18,287 ? 0,0) QPointingDevice::UngrabPassive QQuickTapHandler(0x163dca07ea0, name = "tapHandler")

      Notes

      • Enable "false" on the TapHandler makes the MouseArea react again
      • TapHandler without Item container does not work (only MouseArea active then) (qt.quick.handler.dispatch: QQuickTapHandler "tapHandler" on QQuickItem "" DECLINES QMouseEvent(...))
      • onPressed on MouseArea is not working as well

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

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

              Created:
              Updated:

                There is 1 open Gerrit change