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

MouseArea shouldn't grab the mouse until it actually moves it's drag target.

    XMLWordPrintable

Details

    Description

      MouseArea will currently grab the mouse if there is detects any drag along an enabled axis preventing nested mouse areas or flickables from recognizing drag gestures in opposite directions along the same axis.

      If a mouse area is not going to respond to an initial drag because of limits a drag.minimumX or other it shouldn't grab the mouse, so that in the following example you can drag the blue rectangle around within the yellow, but if it's aligned with a boundary of the yellow rectangle and you drag in the direction of the boundary the yellow rectangle should be moved instead.

      import QtQuick 2.0
      
      Rectangle {
          width: 400
          height: 400
      
          MouseArea {
              id: outer
              objectName: "outer"
              x: 50
              y: 50
              width: 300
              height: 300
      
              drag.target: outer
              drag.filterChildren: true
      
              Rectangle {
                  anchors.fill: parent
                  color: "yellow"
              }
      
              MouseArea {
                  id: inner
                  objectName: "inner"
      
                  x: 0
                  y: 0
                  width: 200
                  height: 200
      
                  drag.target: inner
                  drag.minimumX: 0
                  drag.maximumX: 100
                  drag.minimumY: 0
                  drag.maximumY: 100
      
                  Rectangle {
                      anchors.fill: parent
                      color: "blue"
                  }
              }
          }
      }
      

      Attachments

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

        Activity

          People

            andrew.den.exter Andrew den Exter
            andrew.den.exter Andrew den Exter
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes