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

flick() does not work correctly with ListView

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.3.2
    • 5.1.0 , 5.3.0 Beta1
    • None
    • 2c80968d21ff15f574cbbfd93ce4409cda7eeebf

    Description

      The following code can be used to reproduce the issue:

      import QtQuick 2.0
      
      Item {
          width: 400; height: 400
      
          ListView {
              id: listView
              width: 350
              height: 400
              model: 100
              delegate: Rectangle {
                  height: 40; width: parent.width
                  color: index % 2 ? "lightsteelblue" : "lightgray"
              }
          }
      
          Rectangle {
              width: 50; height: 200
              color: "blue"
              anchors.right: parent.right
              MouseArea {
                  anchors.fill: parent
                  onClicked: listView.flick(0, 1000)
              }
          }
      
          Rectangle {
              width: 50; height: 200
              color: "green"
              anchors.right: parent.right
              anchors.bottom: parent.bottom
              MouseArea {
                  anchors.fill: parent
                  onClicked: listView.flick(0, -1000)
              }
          }
      }
      

      1. Click the green box. The list will scroll all the way to the bottom
      2. Click the blue box. The list will scroll up approximately one screen of items
      3. Click the green box. The list will scroll down approximately 2 pixels.

      Manually flicking the list and then clicking the various buttons will also result in different behavior.

      Expected behavior is that the list will move consistently given a consistent flick() velocity.

      This issue also occurs in Qt 5.2, but seemed somewhat more consistent there (only after manual flick did it break).

      Attachments

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

        Activity

          People

            mbrasser Michael Brasser
            mbrasser Michael Brasser
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes