[Interest] QML required property in view delegate - bug?

Benjamin B (BBenj) balga.benjamin at gmail.com
Fri May 13 16:20:04 CEST 2022


Ah ok, I see, thank you. 

Any thoughts on my 2nd point on the case when a delegate includes an item containing required properties itself (while the delegate doesn’t have any)?

Benjamin 

> Le 13 mai 2022 à 14:30, Ulf Hermann <ulf.hermann at qt.io> a écrit :
> 
> 
>> 
>> Which raises the error "ReferenceError: model is not defined", as documented. Is there a way around this?
> 
> Just add the the "noise" property as another required one and don't access "model" in the delegate. You can do that where you assign to the "text" property. This way it doesn't require you to change SomeDelegate itself. Required properties in delegates are all-or-nothing. You cannot mix them with the traditional way of injecting model data into the context.
> 


More information about the Interest mailing list