[Development] Convenience Imports in QML

Sorvig Morten Morten.Sorvig at digia.com
Wed Dec 12 11:22:59 CET 2012


On Dec 11, 2012, at 4:25 AM, Alan Alpert <416365416c at gmail.com> wrote:
> 
> import Qt 5.0
> 
> Which imports all QML modules in the Qt Essentials released with 5.0.0
> (except QtQuick 1). It would be the equivalent of
> 
> import QtQml 2.0
> import QtQuick 2.0
> import QtQuick.Window 2.0
> import QtQuick.Particles 2.0
> import QtAudioEngine 1.0
> import QtMultimedia 5.0
> import QtWebkit 3.0

How about allowing imports without the version number?

import QtQml -> "give me the most recent QtQml for the current Qt install"

To explain where I'm coming from, look at Qt Creator which compiles agains Qt 4 and Qt 5 from the same branch. This is great: there is a single code base to maintain, there is no confusion on which one to get, and you don't get a combinatorial explosion of branches when you branch Qt Creator for minor releases.

During my (brief) stint as desktop components maintainer I wanted to do the same for those: "absorb" the differences between QtQuick1 and QtQuick2 and present a unified API to users. On the C++ side I had the tools I needed (#ifdefs), but there was no way around the QML imports versioning.

Morten


More information about the Development mailing list