russdot
russdot

Reputation: 685

QML iterate through delegate items in GridView

I have a QML GridView which uses a ListModel. Each ListElement simply defines a color which the delegate reads and creates a colored square.

Is there a way to iterate through the delegate instances and call a function defined in the delegate?

Upvotes: 0

Views: 2195

Answers (1)

Deadron
Deadron

Reputation: 5289

I'm afraid this question is a little light on details. If you can explain a little more what you are attempting to do it may be helpful. Why is it that you want to iterate through the delegate and call functions on them? Keep in mind that Views are used to render QML for each element in the List Model where the model merely supplies data, they are not designed to execute functions. As it is you cannot even assign a function to a ListModel element since QML (last time I checked) does not support assigning functions to properties.

Upvotes: 1

Related Questions