Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.15.2
-
None
-
RHEL 8.4
Description
There are quite a few conditions to fulfil here; the minimal example with comments where I tried to reduce it follows:
import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Controls 2.15 Window { width: 640 height: 480 visible: true title: qsTr("Hello World") // Dropping ScrollView makes positioning work ScrollView { anchors.fill: parent clip: true ListView { id: lv model: 1000 // TopToBottom lists get positioned correctly even when in ScrollView verticalLayoutDirection: ListView.BottomToTop delegate: Text { width: lv.width text: index // The variance in the delegate height is key to the effect; // the formula below was just a way to vary the height. // At smaller variances the 500th delegate may still be // on the screen. font.pixelSize: (index + 10) % 100 } // The actual result is that the 500th delegate is not on the screen, the list view // is positioned somewhere in 51x-52x range instead. // ListView.Center is broken in a similar way. // positionViewAtEnd() seems to work. // positionViewAtBeginning() breaks differently - // will file a separate bug for that. Component.onCompleted: positionViewAtIndex(500, ListView.Contain) } } }