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

Extended syntax to manage the version of QML modules imported

    XMLWordPrintable

Details

    Description

      We've stated to develop an application using Qt Quick 2 using Qt 5.2, however We've moved to Qt 5.3 because, among other things, I was interested in develop customized dialogs.

      The to move from QtQuick 2.1 to QtQuick 2.2 has been painful because we've updated the 'import' statements of all .qml files. We think that the management of versions of QtQuick modules should be extended, to make these management, and migration to newer versions, more easy. These are the proposed changes:

      1. Syntax:

      1.1 In a .qml file, in an 'import' statement, the inclusion of the version of the module should be optional. Examples of valid syntax:

      import QtQuick 2.1
      import QtQuick.Controls 1.0
      import QtQuick
      import QtQuick.Controls

      1.2 Add a command to qmake to specify the default version of module to import in a .pro or in a .pri file. It only specifies the version of modules, and each .qml defines the modules to be imported. Ex:

      QMAKE_QUICK_MODULE QtQuick 2.1
      QMAKE_QUICK_MODULE QtQuick.Controls.Style 1.2

      2. Behaviour:

      For each 'import' statement in a .qml file, to determine the version of the module to import, the following steps should be followed:

      2.1 - If in the 'import' statement, the version of the module is indicated, then the module of the version indicated is loaded. If the module of version to load is not found, then an error is printed and the application aborted.

      2.2 - If the 'import' statement, the version of the module is not indicated, then it is checked if the version of the module is defined in the .pro or .pr1 file.

      2.3 - If the version of the module is indicated in a .pro or .pri file, then the module of the version indicated is loaded. If the module of version indicated is not found, then an error is printed and the application aborted.

      2.4 - The version is not indicated in a .pro or .pri file, then the module with the higher version is loaded.

      Attachments

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

        Activity

          People

            shausman Simon Hausmann
            jduran Joaquim Duran
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes