Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-9627

versioned imports are too permissive

    XMLWordPrintable

Details

    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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            wallison Warwick Allison (closed Nokia identity) (Inactive)
            ckamm Christian Kamm
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes