[Development] QTCS2019 Notes from QtQml session
Ulf Hermann
ulf.hermann at qt.io
Mon Nov 25 17:21:32 CET 2019
On 11/25/19 4:55 PM, Robin Burchell wrote:
> On Mon, Nov 25, 2019, at 3:53 PM, Ulf Hermann wrote:
>> Yes, but the problems with this construct are the same as with
>> generic context properties: Your QML component requires some
>> context that it doesn't declare. Therefore your code is not
>> reusable and brittle wrt addition of properties in other places.
>
> Which is why I also provided a possible solution - by providing
> declaration of that context.
>
> I'm not sure whether you just stopped reading once I started talking
> about the problem, but I'd be interested to hear about whether or not
> something like that approach was considered.
I did read your proposal. I'm not opposed to introducing new language
constructs in order to facilitate easier porting from QML 2 to QML 3.
However, in this particular case, the proposed syntax feels to me very
much like the required properties syntax. If you need to specify both
"expects" and "provides", I don't see the huge benefit over declaring a
required property on the root item of a child component and setting that
from the parent component. Granted, that might be clumsy if you have
many such child components, but remember that we are also introducing
inline components. Therefore, you could declare an inline component with
the required propertiea set in one place and instantiate that in many
places without repeating the property-setting stanza.
This is not set in stone, though. If this is not good enough, we can
introduce a different concept.
Ulf
More information about the Development
mailing list