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

Listview scrollbar changes size and jumps

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2: Important
    • None
    • 5.15.7, 6.4.0
    • None
    • macOS, Windows

    Description

      If there are delegates of different sizes in the ListView
      Then when scrolling, the scrollbar starts jumping and changing size
      Code example:

      import QtQuick
      import QtQuick.Controls
      
      ApplicationWindow
      {
          id: mainWindow
      
          visible: true
          width: 1600
          height: 1070
      
          Component.onCompleted:
          {
              for (let i = 0; i < 100; i++)
              {
                   var data = {'name': new Date().toTimeString(), 'itemHeight': Math.random()*1000};
                  fruitModel.append(data)
              }
          }
      
          ListModel
          {
              id: fruitModel
          }
      
          ListView
          {
              id: listView
              anchors.fill: parent
              spacing: 2
              model: fruitModel
              ScrollBar.vertical: ScrollBar
              {
              }
      
              delegate: Rectangle
              {
                  height: itemHeight
                  width: listView.width
                  Text { text: name }
                  color: Qt.rgba(Math.random(),Math.random(),Math.random(),1);
              }
          }
      
      }
      
      

      A video with a reproduction of the problem is attachedĀ problem.mov

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              andrei haladok Andrei Haladok
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes