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

Flickable can have its flick incorrectly stolen

    XMLWordPrintable

Details

    • 7caf5624d (dev), 4116ff2ae (6.8), 355be8bb6 (dev), e116b9594 (dev), 8b9ae6fa3 (6.8), c6ee51927 (6.8), 2576437ad (dev)

    Description

      A Flickable that is being flicked should continue to hold the mouse grab until the flick ends. This works correctly with the following example:

      1. Flick the view
      2. While the view is still moving, quickly press in the purple area and drag left/right
      3. The total view should pan left/right (the outermost Flickable retains the grab)

      import QtQuick 2.0
      
      Flickable {
          width: 400; height: 400
      
          contentHeight: height
          contentWidth: width * 3
      
          Row {
              Rectangle { width: 400; height: 400; color: "green" }
              Rectangle {
                  width: 400; height: 400; color: "blue"
                  clip: true
      
                  Flickable {
                      width: parent.width
                      height: 200
                      anchors.verticalCenter: parent.verticalCenter
      
                      flickableDirection: Flickable.HorizontalFlick
                      contentHeight: height
                      contentWidth: width + 100
      
                      Rectangle {
                          anchors.fill: parent
                          color: "purple"
                          // uncomment to see issue
                          /*MouseArea {
                              anchors.fill: parent
                              onClicked: console.log("clicked")
                          }*/
                      }
                  }
              }
              Rectangle { width: 400; height: 400; color: "yellow" }
          }
      }
      

      However, if you uncomment the MouseArea indicated above, the following sequence occurs:

      1. Flick the view
      2. While the view is still moving, quickly press in the purple area and drag left/right
      3. The purple area incorrectly pans left/right (it has grabbed the mouse from the outermost Flickable)

      This is a regression from QtQuick 1 – both versions work correctly in that case.

      Attachments

        Issue Links

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

          Activity

            People

              richard Richard Moe Gustavsen
              mbrasser Michael Brasser
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: