Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Where the QML modules version information is defined?
Forum Updated to NodeBB v4.3 + New Features

Where the QML modules version information is defined?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 2.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    michi
    wrote on last edited by
    #1

    Hello, I want to understand where the version information in theQML import statement comes from.

    If I do an import with "import QtQuick 2.12"

    On my system it it loads the module from "C:\Qt\Qt5.12.4\5.12.4\android_armv7\qml\QtQuick" but it seems there is just one version and the version information is not visible.

    Where comes the major.minor version from? An which effect has to select another version.

    When I edit the import statement it gives me several proposals for the version. Where this information comes from and what the different versions are telling me?

    0_1566380756084_2019-08-21 QMLmajor_minor_selection.png image url)

    Is there somewhere some more detailed information about the import system and the versioning? I know the following link but it describes not all my questions in detail.

    https://doc.qt.io/qt-5/qtqml-syntax-imports.html

    Thanks Michael

    sierdzioS 1 Reply Last reply
    0
    • M michi

      Hello, I want to understand where the version information in theQML import statement comes from.

      If I do an import with "import QtQuick 2.12"

      On my system it it loads the module from "C:\Qt\Qt5.12.4\5.12.4\android_armv7\qml\QtQuick" but it seems there is just one version and the version information is not visible.

      Where comes the major.minor version from? An which effect has to select another version.

      When I edit the import statement it gives me several proposals for the version. Where this information comes from and what the different versions are telling me?

      0_1566380756084_2019-08-21 QMLmajor_minor_selection.png image url)

      Is there somewhere some more detailed information about the import system and the versioning? I know the following link but it describes not all my questions in detail.

      https://doc.qt.io/qt-5/qtqml-syntax-imports.html

      Thanks Michael

      sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by sierdzio
      #2

      @michi said in Where the QML modules version information is defined?:

      Hello, I want to understand where the version information in theQML import statement comes from.

      If I do an import with "import QtQuick 2.12"

      On my system it it loads the module from "C:\Qt\Qt5.12.4\5.12.4\android_armv7\qml\QtQuick" but it seems there is just one version and the version information is not visible.

      Versions are defined in C++ files that form the concrete functionality of each item. These are scattered throughout the code (for example here). So all versions for a single component are defined in same place and they share the same code - they are not in different folders.

      Where comes the major.minor version from? An which effect has to select another version.

      Versioning is bloated and will be removed in Qt 6.

      Anyway, for the most part it works like this: in new versions of Qt, a component might get a new property. Let's say fooProperty was added to Item in Qt 5.13. If you use import QtQuick 2.12 it will only load properties from Qt 5.12, so you will get an error if you try to use fooProperty. But when you import QtQuick 2.13, the property is defined and will work.

      Other than that, the version does not matter - you get same functionality and things will work in the same way. So if you later update to Qt 5.14 but keep import QtQuick 2.13, it won't matter. You will still get all the bug fixes from 5.14.

      When I edit the import statement it gives me several proposals for the version. Where this information comes from and what the different versions are telling me?

      See the documentation. Every component shows you exactly what the import statement for given version is. In most modules, the minor version corresponds to Qt minor release: QtQuick.Controls 2.13 == Qt 5.13.

      Is there somewhere some more detailed information about the import system and the versioning? I know the following link but it describes not all my questions in detail.

      https://doc.qt.io/qt-5/qtqml-syntax-imports.html

      I don't know. My recommendation is to ignore versioning as much as you can. If the code works, don't bother with imports.

      (Z(:^

      M 1 Reply Last reply
      2
      • sierdzioS sierdzio

        @michi said in Where the QML modules version information is defined?:

        Hello, I want to understand where the version information in theQML import statement comes from.

        If I do an import with "import QtQuick 2.12"

        On my system it it loads the module from "C:\Qt\Qt5.12.4\5.12.4\android_armv7\qml\QtQuick" but it seems there is just one version and the version information is not visible.

        Versions are defined in C++ files that form the concrete functionality of each item. These are scattered throughout the code (for example here). So all versions for a single component are defined in same place and they share the same code - they are not in different folders.

        Where comes the major.minor version from? An which effect has to select another version.

        Versioning is bloated and will be removed in Qt 6.

        Anyway, for the most part it works like this: in new versions of Qt, a component might get a new property. Let's say fooProperty was added to Item in Qt 5.13. If you use import QtQuick 2.12 it will only load properties from Qt 5.12, so you will get an error if you try to use fooProperty. But when you import QtQuick 2.13, the property is defined and will work.

        Other than that, the version does not matter - you get same functionality and things will work in the same way. So if you later update to Qt 5.14 but keep import QtQuick 2.13, it won't matter. You will still get all the bug fixes from 5.14.

        When I edit the import statement it gives me several proposals for the version. Where this information comes from and what the different versions are telling me?

        See the documentation. Every component shows you exactly what the import statement for given version is. In most modules, the minor version corresponds to Qt minor release: QtQuick.Controls 2.13 == Qt 5.13.

        Is there somewhere some more detailed information about the import system and the versioning? I know the following link but it describes not all my questions in detail.

        https://doc.qt.io/qt-5/qtqml-syntax-imports.html

        I don't know. My recommendation is to ignore versioning as much as you can. If the code works, don't bother with imports.

        M Offline
        M Offline
        michi
        wrote on last edited by
        #3

        @sierdzio Thanks a lot for the explanation. Helped me very much for better understanding the topic.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved