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

[Regression 5.11 -> 5.12] MouseArea doesn't register multple button presses

    XMLWordPrintable

Details

    • Windows
    • 4840668994739054f0976d90eebe9ccfdff0ed81

    Description

      There's a regression in MouseArea's onPressed handler when multiple buttons are pressed:

      import QtQuick 2.9
      import QtQuick.Window 2.2
      
      Window {
          visible: true
          width: 640
          height: 480
          title: qsTr("Hello World")
      
          MouseArea {
              width: parent.width/2
              height: parent.height/2
      
              acceptedButtons: Qt.LeftButton | Qt.RightButton
      
              onPressed: {
                  if (mouse.button === Qt.LeftButton) {
                      console.log("pressed left");
                  } else if (mouse.button === Qt.RightButton) {
                      console.log("pressed right");
                  }
              }
      
              onReleased: {
                  if (mouse.button === Qt.LeftButton) {
                      console.log("released left");
                  } else if (mouse.button === Qt.RightButton) {
                      console.log("released right");
                  }
              }
      
          }
      }
      

      How to reproduce:

      1: Click left button in the MouseArea, keep pressed, and press the right button.
      2. Release the buttons one after the other.

      Expected result (Qt < 5.12):

      qml: pressed left
      qml: pressed right
      qml: released right
      qml: released left

      Actual result (Qt 5.12 Alpha):

      qml: pressed left
      qml: released left

      Attachments

        Activity

          People

            anrocha André De La Rocha (Inactive)
            VersalEszett Julius Bullinger
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: