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. QML module versions
Forum Updated to NodeBB v4.3 + New Features

QML module versions

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 3.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.
  • D Offline
    D Offline
    dhal
    wrote on last edited by
    #1

    Hi,

    Does anyone know how QML versions for modules actually work? The description from the documentation: "http://doc.qt.nokia.com/latest/qdeclarativemodules.html":http://doc.qt.nokia.com/latest/qdeclarativemodules.html :
    "A single module, in all versions, may only be provided in a single directory (and a single qmldir file). If multiple are provided, only the first in the search path will be used (regardless of whether other versions are provided by directories later in the search path)."

    When I tried my own example, as soon as the importer (with QML_IMPORT_TRACE defined) found an import path where the requested module existed, say with version 1.0 specified in the qmldir, then it gave a runtime error because my QML source file was trying to import version 2.0. It didn't go on to look at other paths that are in the import path list to see if the other module version existed there.

    Regarding the quote above: How can a single module be provided in a single directory with multiple versions? I thought the title of the file gives the name to the component, so you can only have one module file by that name.

    Thanks

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vsorokin
      wrote on last edited by
      #2

      See "this example":http://doc.qt.nokia.com/4.7/gettingstartedqml.html#extending-qml-using-qt-c

      --
      Vasiliy

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dhal
        wrote on last edited by
        #3

        Answering my own post here, but I found that you can have any name for the component qml file if you are using qmldir for an installed module. For example, component Button can be in xyz.qml if qmldir has the line "Button 1.0 xyz.qml". If there is no qmldir file, then the default convention is that component Button is in the file Button.qml.

        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