Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Unable to see QML Components in non-project folder in Qt Designer

Unable to see QML Components in non-project folder in Qt Designer

Scheduled Pinned Locked Moved Qt Creator and other tools
qtdesigner
2 Posts 2 Posters 1.2k 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.
  • J Offline
    J Offline
    Jennise Hall
    wrote on last edited by
    #1

    I'm working on a project that is importing custom QML Components stored in a directory that is NOT under my project directory.

    My project directory (/home/myHome/ProjectA) contains components that use common base components that are stored in a common directory (/home/myHome/groupFolder/CommonComponents) that other engineers working on different projects can also access. (see attached image)

    quick example of this structure

    • We have added CommonComponents path to my .qmlproject file (i.e.
      importPaths: ["/home/myHome/CommonComponents"] )

    • in /home/myHome/CommonComponents there is a qmldir file that:

    module commoncomponents
    BaseCircle 1.0 BaseCircle.qml
    Angle 1.0 Angle.qml
    Box 1.0 Box.qml

    and I have added import commoncomponents 1.0 at the top of GCircle.qml for example.

    When working in the Qt Creator text editor all works fine. I can get to properties defined in BaseCircle.qml. When I run the application all looks as intended.

    However, if I open Qt Designer I do NOT see BaseCircle on the QMLTypes tab. This, happens automatically if a QML file is in the same directory as the QML file I am editing, or in a directory below it. Is there a way to see those QML components in the QML Types tab in Qt Designer?

    1 Reply Last reply
    1
    • T Offline
      T Offline
      ThomasHartmann
      wrote on last edited by
      #2

      The designer does not pick up the items from a plugin automatically.
      But you can write a .metainfo file that defines the contents of the item library.

      An example can be found here: https://github.com/qtproject/qt-creator/tree/master/tests/manual/qml/testprojects/plugins.

      Just have a look at: MyPlugin.metainfo

      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