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

MouseArea counts click on other MouseArea as first click of the double click

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • None
    • 5.7.0
    • None
    • Android 6.0 , Android 7.0

    Description

      On Android when tapping once on MouseArea1 and then quickly on MouseArea2 the first click counts towards the second click for MouseArea2 and therefore calls doubleClick on MouseArea2 immediately.

      import QtQuick 2.7
      import QtQuick.Window 2.2
      
      Window {
          visible: true
          width: 640
          height: 480
          title: qsTr("Hello World")
      
          color: "black"
      
          Item {
              anchors.fill: parent
      
              Rectangle {
                  id: left
      
                  width: parent.width * 0.45;
      
                  anchors.left: parent.left
                  anchors.top: parent.top
                  anchors.bottom: parent.bottom
      
                  color: "red"
      
                  Text {
                      anchors.fill: parent
      
                      horizontalAlignment: Text.AlignHCenter
                      verticalAlignment: Text.AlignVCenter
      
                      text: "Rotated: " + (left.rotation !== 0)
      
                      font.bold: true
                      minimumPixelSize: 1
                      font.pixelSize: 1000
                      fontSizeMode: Text.Fit
                  }
      
                  MouseArea {
                      anchors.fill: parent
      
                      onDoubleClicked: {
                          if (left.rotation !== 0) {
                              left.rotation = 0;
                          } else {
                              left.rotation = 90;
                          }
                      }
      
                      onPressed: left.color = "yellow"
                      onReleased: left.color = "red"
                  }
              }
      
              Rectangle {
                  id: right
      
                  width: parent.width * 0.45;
      
                  anchors.right: parent.right
                  anchors.top: parent.top
                  anchors.bottom: parent.bottom
      
                  color: "green"
      
                  Text {
                      anchors.fill: parent
      
                      horizontalAlignment: Text.AlignHCenter
                      verticalAlignment: Text.AlignVCenter
      
                      text: "Rotated: " + (right.rotation !== 0)
      
                      font.bold: true
                      minimumPixelSize: 1
                      font.pixelSize: 1000
                      fontSizeMode: Text.Fit
                  }
      
                  MouseArea {
                      anchors.fill: parent
      
                      onDoubleClicked: {
                          if (right.rotation !== 0) {
                              right.rotation = 0;
                          } else {
                              right.rotation = 90;
                          }
                      }
      
                      onPressed: right.color = "yellow"
                      onReleased: right.color = "green"
                  }
              }
          }
      }

      Attachments

        Issue Links

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

          Activity

            People

              smd Jan Arve
              basyskom_daniel_engelke Daniel Engelke
              Votes:
              3 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes