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

MouseArea between pointer handlers does not block

XMLWordPrintable

      If MouseArea is on top of pointer handlers, it will consume the event, but when MouseArea is between pointer handlers, it seems completely ignored.

      That means in a case like this both onTappend handlers are called:

      import QtQuick.Controls
      import QtQuick.Window
      import QtQuick
      
      Window {
          id: root
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
      
          Rectangle {
              width: 80
              height: 80
              color: "red"
      
              TapHandler {
                  onTapped: console.log("red")
              }
          }
      
          MouseArea {
              anchors.fill: parent
          }
      
          Rectangle {
              width: 80
              height: 80
              color: "blue"
      
              TapHandler {
                  id: b
                  onTapped: console.log("blue")
              }
          }
      }
      

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

            srutledg Shawn Rutledge
            poikelin Joni Poikelin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes