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-Designer and external Components
Forum Updated to NodeBB v4.3 + New Features

QML-Designer and external Components

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 1.4k 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.
  • K Offline
    K Offline
    kortus
    wrote on last edited by
    #1

    The problem I have is, that the qml designer not found my reusable components. This components lie in a separate directory named MwComponents and there is a qmldir file.

    To use this components in an application I create a resource file with this components and add the import statement.

    @viewer->engine()->addImportPath("qrc:/modules/qml");@

    Now I can import this components using

    @import MwComponents 1.0 as MWC@

    and it works. The Texteditor can resolve the components, I think the reason is the variable in the .pro file

    @QML_IMPORT_PATH += "$${MW_ROOT_PATH}/src/hmi/MwQml/qml"@

    But the designer will not show the components.

    1 Reply Last reply
    0
    • F Offline
      F Offline
      fxam
      wrote on last edited by
      #2

      Try QML2_IMPORT_PATH

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

        Hi, this will not work. I have set the variable in the .pro file and as environment variable.
        Where shows the QML-Designer this new components? QML-components section show the qml-files from the same directory.

        1 Reply Last reply
        0
        • F Offline
          F Offline
          fxam
          wrote on last edited by
          #4

          Did you try QML2_IMPORT_PATH in environment? Not QML_IMPORT_PATH.

          For the pro file, try full path for QML_IMPORT_PATH first, instead of using MW_ROOT_PATH. Eg:
          @
          QML_IMPORT_PATH += "/home/foo/src/hmi/MwQml/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