[Interest] Keeping QML module versions up to date in a project

Attila Csipa qt at csipa.in.rs
Wed Nov 26 23:09:55 CET 2014


On 11/26/2014 7:34 PM, Thiago Macieira wrote:
> On Wednesday 26 November 2014 13:29:12 Attila Csipa wrote:
>> The import versioning system as done by Qt is a sort of API handshake -
>> it doesn't actually select between different implementations, you just
>> select feature-sets. Thus, you should always import the latest (for
>> better or worse). Unfortunately, Qt has no wildcard import syntax (or
>> for "latest").
> You should import the latest when you write the application. But if the
> library is updated behind your back, the import shouldn't change. Thus, if
> there is new behaviour you didn't test with, your application won't be
> affected.
>

Still - the only guarantee you get with a specific import version is 
that of the API, but not the behavior. Thus, it's perfectly possible 
that someone swaps the libs and your app *IS* affected. See for example 
the "QML instantiation
performance thread". You likely won't blow up, but far from "can't be 
negatively impacted" by having the lib updated behind your back.

To add insult to injury, it's actually pretty hard to find out what was 
introduced when, so your imports will reflect "which version of Qt I 
developed my app with" rather than "what Qt features does my app require".

Thus, the way versioning is done, combined with a lack of conditionals 
is making it really hard to maintain a QML file/app when you're not the 
one bundling the Qt libs. I still fail to grasp why this is such a 
no-no. If it's okay to have a

#if QT_VERSION >= QT_VERSION_CHECK(5,3,0)

...why can't we have something functionally equal for QML? As it is now, 
whenever I decide to add support for a new feature, I make my QML 
incompatible with older Qt versions (which is understandable) with no 
way of defining a fallback or alternative (which is not OK) regardless 
how trivial the new feature is.

Best regards,
Attila



More information about the Interest mailing list