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

ListView - contentY goes crazy

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4: Low P4: Low
    • None
    • 5.6.0, 5.7.0, 5.9.0 Alpha
    • None
    • osx, windows
    • macOS

      In our original application, the contentY of the ListView takes a negative value after updating a delegate item (by updating model content from c++) That causes a jump above listview begin automatically although we're not touching contentY or trying to move ListView in some other way.

      import QtQuick 2.7
      import QtQuick.Controls 1.5
      import QtQuick.Dialogs 1.2
      
      ApplicationWindow {
        visible: true
        width: 640
        height: 480
      
        ListView {
          id: listView
          anchors.fill: parent
          model: testModel
      
          delegate: Text {
            id: delegateItem
            width: listView.width
            height: 40
            horizontalAlignment: Text.AlignHCenter
            verticalAlignment: Text.AlignVCenter
            text: name_role
      
            Repeater {
              model: 10
              delegate: Image {
                source: "qrc:///test.png"
                cache: false
                visible: false
              }
            }
          }
        }
      
        Button {
          id: button
          anchors.right: parent.right
          anchors.bottom: parent.bottom
          anchors.margins: 10
          text: "test bug"
          onClicked: {
            testModel.modifyName(40, "asdasdads")
            testModel.removeRow(30)
          }
        }
      }
      

      By a repeater we tried to simulate that delegate is heavier. On windows its diffucult to reproduce this problem (but it appears in some cases) on osx you shall see the same issue as on attached movie. "Test bug" button doesn't seems to cause an issue but in our original project - idea of updating delegate remains nearly the same

      everything works fine on Qt 5.5

        1. scroll.zip
          28 kB
        2. scroll-bug.mov
          808 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            srutledg Shawn Rutledge
            krzysztoff7 Krzysztof
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes