Solved Set a property of item in a DelegateModel
-
Hi,
I have a
GridView
which uses aDelegateModel
as its model:GridView{ model: DelegateModel{ id: visualModel model: programModel delegate: ProgramButton {} } }
How can I set a property of a delegate if I know its index?
-
@maxwell31 hi;
model: DelegateModel{ id: visualModel model: programModel yourProperty : index===yourIndex ? propValue1 : propValue2 delegate: ProgramButton {} }
-
Thanks for your answer. However, after some thinking I guess it was a poor design to even try to do that. I should change the model instead.