Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.6.0 Beta, 5.6.0, 6.3.2
-
Android (armeabi-v7a)
iOS
Windows 7 (Mingw x32)
Windows 10 (MSVC 2019-64bit)
Description
When using GridView or ListView with a Loader as delegate, the filling direction is always from bottom-right to top-left.
Loaders are ready one by one from the last to the first item in the ListModel.
But it's more logical and clean to have elements appearing from left to right. Isn't it ?
Given bellow an example, which indicates clearly the bug :
example.qml
import QtQuick 2.5 ListView { id: listView anchors.fill: parent model: ListModel { id: data ListElement { url: "https://images.unsplash.com/photo-1453743327117-664e2bf4e951?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&s=d5447d7f37886d9890d448d0858da12f" } } property bool nextLoaded: false function loadNext() { if (!nextLoaded) { nextLoaded = true; var next = [ { url: "https://images.unsplash.com/photo-1452800185063-6db5e12b8e2e?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&s=2700f9770386e4c5ebc53502a9099966" }, { url: "https://images.unsplash.com/photo-1452274381522-521513015433?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&s=476b9724fcf47b51c652d66e384f9ba0" } ]; data.append(next); } } onContentYChanged: { if (contentHeight - contentY - height < 1000) loadNext(); } delegate: Component { Loader { width: parent.width height: 200 asynchronous: true visible: status == Loader.Ready onStatusChanged: { if (status == Loader.Ready) { console.log("loader "+index+" is ready"); } } sourceComponent: Component { Image { source: url cache: false asynchronous: true anchors.fill: parent fillMode: Image.PreserveAspectCrop onStatusChanged: { if (status == Image.Loading) { console.log("image "+index+" is loading"); } } } } } } }
After appending the 2 new images in the list, you can see in the console :
console
qml: image 2 is loading qml: loader 2 is ready qml: image 1 is loading qml: loader 1 is ready
Attachments
Issue Links
- relates to
-
QTBUG-35502 Delegates complete in reverse order when using asynchronous loaders with GridView/ListView
- Closed