ListView contentHeight keeps changing
-
Hello,
I've noticed if I have multiple different height elements in a list view, it's contentHeight keeps changing when scrolling.
I've noticed there's a bug reported related to this, but it says that it's the intended functionality.
That is very weird, because if you have a ScrollBar in the ListView, the ScrollBar height keeps changing when scrolling.
I just wanted to make sure if this really is the intended funcionality, not a bug.Tested on Qt 5.14.2, 5.15.2 & 6.2.1
Minimal code required to reproduce the issue:import QtQuick 2.14 import QtQuick.Window 2.14 import QtQuick.Controls 2.5 Window { width: 640 height: 480 visible: true title: qsTr("Hello World") ListView { width: parent.width height: parent.height model: [ 50, 100, 50, 100, 50, 100, 50, 100, 50, 100, 50, 100, 50, 100, 50, 100, 50, 100, 50, 100 ] ScrollBar.vertical: ScrollBar { id: scrollbar width: 16 } onContentHeightChanged: console.log("content.height: " + contentHeight + " contentItem.height: " + contentItem.height) delegate: Rectangle { width: parent.width height: modelData border.width: 1 border.color: "black" } } }