import QtQuick 2.15 import QtQuick.Window 2.15 import QtQml.Models 2.15 import QtQuick.Controls 2.15 Window { width: 640 height: 480 visible: true title: qsTr("List View with non-uniform height items") ListModel { id: rectangleModel ListElement { color: "purple" height: 70 } ListElement { color: "green" height: 700 } ListElement { color: "blue" height: 50 } ListElement { color: "yellow" height: 2000 } ListElement { color: "red" height: 100 } ListElement { color: "pink" height: 200 } ListElement { color: "orange" height: 1000 } } ListView { id: rectancgleList anchors.fill: parent spacing: 10 model: rectangleModel delegate: Rectangle { height: model.height width: rectancgleList.width color: model.color } ScrollBar.vertical: ScrollBar { policy: ScrollBar.AlwaysOn } } }