[Interest] What do QML import statements do?

Jason H jhihn at gmx.com
Thu Nov 10 17:17:53 CET 2016


import QtQuick.Controls 1.4

In the format: import module version
import: obvious enough
module: obvious enough
version: this is far from obvious

I have several questions about what does the version specifier actually does:
At runtime, If the version is lower than the max version (1.2 for example) does it specifically import 1.2? Will it attempt that and fall forward to 1.3, 1.4, etc?
At runtime or compile time, when I use multiple versions of a module in my source, is each one loaded? 
Why should I care what version it is? Can't I just always specify the latest? Why would I not want the latest? Why can't I just leave the version off or * or 1.*? (Admittedly, when you change the major version, it may want to stay within the same major version. i.e. 1.*)

I can of course understand having versions documented for when controls are added ("since v1.3", etc.)







More information about the Interest mailing list