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

Dragging inside a ListView delegate causes the ListView to scroll at lower speed, even after the drag is over

    XMLWordPrintable

Details

    • 9c70c81e6af2435d8d8217b81714b2e087326ecf

    Description

      This is a weird issue, possibly related to Flickable. Took us long to isolate.

      Steps to reproduce:

      1. Launch the code below in qmlviewer.exe
      2. Use the mouse wheel to scroll the list. Notice how fast it scrolls. Here, we are getting top speeds around 700 px/s
      3. click on any item in the list and drag and drop it somewhere. Doesn't matter where/
      4. Now scroll with the mouse wheel again and notice that it is scrolling much slower. Our top speed now is around 150 px/s
      5. If you click anywhere, the scrolling speed is fast again. It seems that this somehow "releases" the drag.
      import Qt 4.7
      
      Rectangle {
      	width: 200
      	height: 200
      
      	ListView {
      		id: list
      		anchors.fill: parent
      		model: 300
      		delegate: Text {
      			text: index
      			MouseArea {
      				anchors.fill: parent
      				drag.target: dragTarget
      			}
      		}
      	}
      	Item {
      		id: dragTarget
      	}
      
      	// Just for debugging: show the scrolling speed. Removing this won't affect the problem
      
      	Text {
      		property int topSpeed: max(list.verticalVelocity)
      
      		function max(s) {
      			s = Math.abs(s)
      			return (s > 0) ? Math.max(topSpeed, s) : 0;	//nevermind the binding loop here, only for debugging purposes
      		}
      
      		anchors {top:  parent.top; right: parent.right}
      		horizontalAlignment: Text.AlignRight
      		text:  "Speed: " + Math.round(list.verticalVelocity) + " pixels/s \n Top: " + topSpeed
      	}
      }
      

      Attachments

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

        Activity

          People

            martjone Martin Jones (closed Nokia identity) (Inactive)
            gregschlom Gregory Schlomoff
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes