load a specific image for each item of listview
Hiii everyOne,
I have a listView that contains some elements :
Code:
ListView {
model: menuModel
delegate: categoryDelegate
...
}
ListModel {
id: menuModel
ListElement {
...
Component {
id: categoryDelegate
Column {
Rectangle {
id: categoryItem
...
Image {
id: img
...
}
I want for each element (each rectangle) load a specific image
The code above load the same image for each element
Cheers,
Re: load a specific image for each item of listview
Put the image URL into the model, let the delegate get the data from the model just like any other data.
Cheers,
_
Re: load a specific image for each item of listview
For Detail Information, here is what you need
https://wiki.qt.io/How_To_Use_QML_ListView
Re: load a specific image for each item of listview
Thanks, That's right
I want for each image modify : sourceSize ???
Cheers,
Re: load a specific image for each item of listview
Again, just extend the model :)
You might need to split the size in a sourceWidth and sourceHeight property
Cheers,
_