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

Items not positioned correctly if moving multiple items to the top of a ListView

    XMLWordPrintable

Details

    • 01daf72ee66fb3fb5d9378ecaa42c9ace8bc6c76

    Description

      With the following, press space to execute a move(10, 0, 2).

      Observe Item 11 is now at the top of the list at (0,0) and Item 10 is at (0, -20).

      Instead, Item 10 should be at (0,0) and Item 11 should be at (0, 20).

      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})
                      }
                  }
              }
              delegate: Rectangle {
                  width: 200; height: 20; border.width: 1
                  Row {
                      Text { text: name + " : " + index + " : " }
                      Text { text: " " + parent.parent.x + ", " + parent.parent.y }
                  }
                  objectName: name
              }
      
              focus: true
              Keys.onSpacePressed: {
                  model.move(10, 0, 2)
              }
          }
      
          Rectangle {
              anchors.fill: view2
              color: "lightsteelblue"
              opacity: 0.3
      
          }
          Text { anchors.right: parent.right; text: "content y:" + view2.contentY + ", count: " + model2.count }
      
      }
      

      Attachments

        For Gerrit Dashboard: QTBUG-22762
        # Subject Branch Project Status CR V

        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