Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Qml Library

    QML and Qt Quick
    3
    5
    2336
    Loading More Posts
    • 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
      MaxL last edited by

      Hi everyone,

      I have seen that it is possible to create a library from C++ so it can be used as a plugin in QML.
      I was wondering if it was possible to do the same but from QML to QML.
      I have some custom objects that i would like to regroup in on library so in future project i only have to do "import MyWidgets" and add this library in the project. Without having to copy every .qml files into the new project as well as pictures.

      If anyone has an idea on the subject I would really appreciate it ?
      Thanks

      1 Reply Last reply Reply Quote 0
      • C
        chrisadams last edited by

        Hi,

        See http://qt-project.org/doc/qt-5.1/qtqml/qtqml-modules-topic.html for information on creating QML modules (which can be imported by QML applications or other modules).

        Cheers,
        Chris.

        1 Reply Last reply Reply Quote 0
        • M
          MaxL last edited by

          Thanks for the link, it was what I was looking for

          1 Reply Last reply Reply Quote 0
          • M
            MaxL last edited by

            So I need a little bit of help. I created a specific folder at the root of my project with all my .qml files as well as the qmldir file.
            I am now looking on how to import it so I can use import MyModule 1.0 and to be sure that files are embedded with the app.

            Any idea on how to it ? I have tried with QQmlEngine::addImportPath() with no success, as well as trying to set QML2_IMPORT_PATH.

            1 Reply Last reply Reply Quote 0
            • V
              Vincent007 last edited by

              You need to use "Qt resource system":http://doc-snapshot.qt-project.org/qt5-nosubdir/qtquick-deployment.html

              1 Reply Last reply Reply Quote 0
              • First post
                Last post