@GrecKo the problem is, that GridView releases it delegates when model's elements is removed. It provokes Image to reload if delegate is shown again. No meter if I set cache: true
Such a shame that GridView don't have reuseItems like ListView
I've come with next decision. I've created Repeater containing Image that use source model. GridView's delegate Image use Repeater's function itemAt() giving delegate's index after mapping to source model:
//Image in deleagte
Image {
Component.onCompleted: {
source = appModelImages.loadImage(appFilterModel.mapRowToSource(parent.delegateIndex)) // custom implementation
}
...
}
//Repeater
Repeater {
id: appModelImages
visible: false
function loadImage(index){
return itemAt(index).source
}
model: AppModel
delegate: Image {
visible: false
asynchronous: true
source: model.boxart
}
}
This may be not the best decision, but "faster" than create own delegate pool for GridView. Didn't see any examples of implementing mechanism like this. Repeater should work fine, as it relays on source model. And as I expected, images live when source model does.