Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.7.0
-
None
Description
Say you start out on a button library:
initial qmldir: Button 1.0 filename
and later extend it
newer qmldir: Button 2.0 otherfile Button 1.0 filename
Now, someone writes an application against the newer library and does
import Button 2.0
but the user trying to run that application only has the 1.0 library installed. With the current scheme of import resolution, the first line that has a version <= the specified version will be used for each type: so the application would try to run with Button 1.0.
In other words: there's no way to specify a minimum version at the moment, Qml imports only set a maximum version. That can't work; it'd mean an application doing import Qt 7.0 might legally get Qt 4.7 components and be expected to work.
I suggest this to be fixed by looking at the highest version number in a qmldir file. If the version in the import is greater than that one, the import should error. That'd still allow importing older versions if a new version of a library is installed while preventing imports of versions that are newer than the installed library can provide.