Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.12.0
-
None
-
openSUSE Tumbleweed 20181224 x86_64
-
ff30fc5f5f637da6a06a33ae0e55d5e4b798099d (qt/qtquickcontrols2/5.12)
Description
The following QML code worked as expected producing a scrollable list of numbers in Qt 5.11, but produces a scrollable list of white space instead in Qt 5.12.0. The text is not visible because all ItemDelegates have zero width. Uncommenting either line (1) or line (3) works around the issue. However, explicitly setting contentWidth on ListView as in line (2) does not help.
Tested on Linux using qmlscene.
import QtQuick 2.11 import QtQuick.Controls 2.4 Item { width: 250 height: 500 ScrollView { anchors.fill: parent // contentWidth: listView.contentWidth // workaround (1) ListView { id: listView // contentWidth: width // not workaround (2) delegate: ItemDelegate { // implicitWidth: 0 // workaround (3) width: parent.width text: index } } } Component.onCompleted: listView.model = 100 }