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

HoverHandler eats click events

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 5.15.2
    • None
    • Android, Linux/X11

      When adding a DragHandler, any stylus events will be consumed by and not forwarded to other items. Other events like mouse or touch events will be propagated to other items as well.

      The following code prints "dragged" for stylus and mouse. It will only print "hit me again" for mouse events.

      With Qt 5.14, this was still working as expected and would also react to the button clicked events with a stylus input.

      import QtQuick 2.12
      import QtQuick.Window 2.12
      import QtQuick.Controls 2.12
      
      Window {
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
          Rectangle {
              anchors.fill: parent
              DragHandler {
                  onTranslationChanged: console.warn('dragged')
              }
          }
      
          Button {
              text: "Clickme"
              x: 0
              y: 0
              width: 50
              height: 50
              onClicked: console.warn("hit me again")
          }
      }
      

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

            srutledg Shawn Rutledge
            mkuhn Matthias Kuhn
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes