[Solved] Create listmodel in a function
-
Hi,
I need create a listmodel in a function, it's possible? the creation of listmodel must be dynamic :s
example:
@ListModel {
id: myModel
ListElement {
tag: "Directory1"
photos: [
ListElement { path: "c:\img1.jpg" },
ListElement { path: "c:\img2.jpg" }
]
}
ListElement {
tag: "Directory2"
photos: [
ListElement { path: "c:\img3.jpg" },
ListElement { path: "c:\img4.jpg" }
]
}
}@
Thanks -
You've marked thread as solved so it will be good to share with others your solution.
BTW, you've simply used append() method of model or something else more complex?
-
I am also interested in seeing how you created a dynamic list. This would help greatly. Like do you do some array type work as well?