[Interest] #define in qml

Thiago Macieira thiago at kde.org
Mon Feb 20 08:53:14 CET 2012


On segunda-feira, 20 de fevereiro de 2012 08.23.26, Bo Thorsen wrote:
> Den 19-02-2012 21:00, Thiago Macieira skrev:
> > On domingo, 19 de fevereiro de 2012 20.41.56, qtnext wrote:
> >> Hi,
> >> 
> >> I wants to start testing my Qml apps (qt4.8, quick 1.1)  with Quick2 Qt5
> >> ... But how can I easily test it with Qt5 with a working Qt4 source ..
> >> Is there any way to define #ifdef QT5 import Quick 2.0 #else import
> >> Quick 1.1  ?
> > 
> > That's not how you're supposed to do it.
> > 
> > You're supposed to upgrade to Qt Quick 2.0 when you're ready to upgrade
> > and
> > never look back. Then you make sure it looks correct when you do.
> 
> Which means it's quite difficult to create add-on products for QML that
> supports multiple versions.

Again, not the use-case. You don't support multiple versions of Qt Quick. 
Multiple versions of Qt Quick support you.

If you import Qt Quick 1.1, it will be the same version of 1.1 with the same 
behaviour issues. If you don't change the import statement, the behaviour will 
not change, even if Qt is upgraded.

It's also possible to have different .qml files having slightly different 
imports. You just can't mix major versions, because the backend library is 
completely different.

> I don't know how to solve this, though. Adding a preprocessor over QML
> files just feels fundamentally wrong to me, but it might be the only
> solution for a QML library vendor.

I'm interested in what other problems you might have as a QML library vendor 
(not an application vendor).

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120220/518f6f27/attachment.sig>


More information about the Interest mailing list