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. How to implementing qml module identified?
Qt 6.11 is out! See what's new in the release blog

How to implementing qml module identified?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
5 Posts 2 Posters 783 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.
  • K Offline
    K Offline
    kangherr
    wrote on last edited by
    #1

    I'm confused about implementing Use QML Module with Plugin, there are my references
    https://doc.qt.io/qt-5/qtqml-modules-identifiedmodules.html#semantics-of-identified-modules
    https://doc.qt.io/qtcreator/creator-qml-modules-with-plugins.html

    My goal is I can import my custom QML modules as "import My.Modules 1.0" then QtDesign/QML-Preview can render it.

    Here my project directory structure and error what I get:
    Screen Shot 2020-07-06 at 06.50.13.png

    On the popup message, said that I already added my custom QML module path to QML_IMPORT_PATH, but QtCreator still said can not find the module.

    How to resolve it?

    My Tools: MacOS Catalina + Qt5.14

    1 Reply Last reply
    0
    • Quang PhuQ Offline
      Quang PhuQ Offline
      Quang Phu
      wrote on last edited by Quang Phu
      #2

      @kangherr , you can add QML_IMPORT_PATH = $$PWD in your .pro file and make sure have engine.addImportPath("qrc:/"); in your main.cpp file.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kangherr
        wrote on last edited by
        #3

        @Quang-Phu Thanks for your reply but still not work on my project.
        Here my code:
        https://github.com/mangherr769/QtUsingModuleWithPlugin

        Feel free to modify my code to show the working example. Thanks.

        1 Reply Last reply
        0
        • Quang PhuQ Offline
          Quang PhuQ Offline
          Quang Phu
          wrote on last edited by Quang Phu
          #4

          @kangherr ,
          It seems you have to create other resource file (*.qrc) to import as a module.
          https://github.com/1799/QtUsingModuleWithPlugin
          This source code works, you can try it.

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kangherr
            wrote on last edited by
            #5

            @Quang-Phu Oh Ok it's work, just to separate the component's resources with main QML resources. Thanks.

            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