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

ListView adds/removes items unnecessarily at top of view when flicked past the bottom

    XMLWordPrintable

Details

    • c0fe60cad2c48f18e618c3ca4589abe73752389e

    Description

      View is refilling unnecessarily.

      Take the following example:

      import QtQuick 2.0
      
      Item {
          width: 500; height: 500
      
          ListView {
      
              id: view2
              width: 240; height: 320
              x: 100
              y: 100
      
              model: ListModel {
                  id: model2
                  Component.onCompleted: {
                      for (var i=0; i<30; i++) {
                          append({'name': 'item ' + i, 'size': 20 })
                      }
                  }
              }
              delegate: Rectangle {
                  width: 240; height: size; border.width: 1
                  color: index % 2 == 0 ? "orange" : "green"
                  Row {
                      Text { text: name + " : " + index + " : " }
                      Text { text: " " + parent.parent.x + ", " + parent.parent.y }
                  }
                  objectName: name
              }
              highlight: Rectangle { width: 100; height: 100; color: "red"; opacity: 0.5; z:2 }
          }
      
      
          Rectangle {
              anchors.fill: view2
              color: "lightsteelblue"
              opacity: 0.7
      
          }
      }
      

      Flick to the end, and as the view settles following the flick, the top item outside of the view area flickers several times.

      Attachments

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

        Activity

          People

            bealam Bea Lam (closed Nokia identity) (Inactive)
            bealam Bea Lam (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes