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 Library

Qml Library

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 3 Posters 2.6k Views
  • 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
    MaxL
    wrote on last edited by
    #1

    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
    0
    • C Offline
      C Offline
      chrisadams
      wrote on last edited by
      #2

      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
      0
      • M Offline
        M Offline
        MaxL
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0
        • M Offline
          M Offline
          MaxL
          wrote on last edited by
          #4

          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
          0
          • V Offline
            V Offline
            Vincent007
            wrote on last edited by
            #5

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

            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