[Development] QTCS2019 Notes from QtQml session

Eike Ziller Eike.Ziller at qt.io
Mon Nov 25 10:25:00 CET 2019



> On 22. Nov 2019, at 11:52, Kai Uwe Broulik <kde at privat.broulik.de> wrote:
> 
> Hi,
> 
> > these are the notes on the QtQml session:
> 
> > Versioning
> > ----------
> >
> > Once we get rid of unqualified lookups we don't need any QML versioning
> > anymore. At least the minor version will become optional already in 5.15
> > for well-behaved QML documents. In QML 3 it won't be allowed.
> 
> While I agree with this overall, there's still one caveat which I haven't seen discussed yet:
> 
> Imagine I have the following code:
> 
> Item {
>    id: foo
>    property color prettyColor: "#f0f"
> 
>    Rectangle {
>        color: foo.prettyColor
>    }
> }
> 
> Right now "foo" refers to the Item. What if in a future update, Rectangle gains a new property "foo". Unless you want to force everyone to be explicit by using "this" (e.g. width: this.height) everywhere, which would be annoying, I don't see how this can be made future-proof without some form of versioning or some other magic solution?

Similar things can happen in C++ with method names.
C++ got the ‘override’ keyword to make these breakages detectable by tooling.
It looks to me like the case id==propertyname would also be detectable by tooling?

Br, Eike

-- 
Eike Ziller
Principal Software Engineer

The Qt Company GmbH
Erich-Thilo-Straße 10
D-12489 Berlin
eike.ziller at qt.io
http://qt.io
Geschäftsführer: Mika Pälsi,
Juha Varelius, Mika Harjuaho
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B



More information about the Development mailing list