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. Custom QML Components don't show in QtCreator Item pane
Qt 6.11 is out! See what's new in the release blog

Custom QML Components don't show in QtCreator Item pane

Scheduled Pinned Locked Moved Qt Creator and other tools
7 Posts 3 Posters 7.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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I have install some 3rd party QML components, such as QtDesktop, QMLTemplate and so on. But all the components won't show in the item pane, so I can't drag&drop components.
    After tracing the source code of QtCreator, I found that the QML component parser(SubComponentManager) won't add those components into Item library, it passes "false" to the function parseDirectory(), I am confused why it pass false rather than true. Have anybody know about that?

    subcomponentmanager.cpp line 194
    @
    foreach (const QString &path, importPaths()) {
    url.replace(QLatin1Char('.'), QLatin1Char('/'));
    url = path + QLatin1Char('/') + url;
    QFileInfo dirInfo = QFileInfo(url);
    if (dirInfo.exists() && dirInfo.isDir()) {
    //### todo full qualified names QString nameSpace = import.uri();
    parseDirectory(dirInfo.canonicalFilePath(), false);
    }
    }
    @

    [Edit: added @ tags; mlong]

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      The item library is populated by the components of the current projects in by plugins (qtquickplugin, symbianplugin, desktopplugin...).

      Since we provide a QtDesktop components plugin you should see the desktop components in the Qt Quick Designer if you import the desktop components in your qml file (import QtDesktop 0.1).

      We do not show components if no meta information are present and the import is underlined in the text editor.

      1 Reply Last reply
      0
      • cmessineoC Offline
        cmessineoC Offline
        cmessineo
        wrote on last edited by
        #3

        What meta information does the QML component parser look for? Any examples?

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          The Qt Quick Designer needs to know the type/class hierarchy and needs to know the names and types of properties.

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            [quote author="ThomasHartmann" date="1340720254"]The Qt Quick Designer needs to know the type/class hierarchy and needs to know the names and types of properties.[/quote]

            Does the information provide by qmlplugindump?

            1 Reply Last reply
            0
            • ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #6

              Hi Thomas, thanks for your response, but I didn't see any cule in the above code show that the problem is due to the lack of meta info:
              @parseDirectory(dirInfo.canonicalFilePath(), false);@
              It just pass "false", and than the components won't show in the pane, right?

              1 Reply Last reply
              0
              • ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #7

                The SubComponentManager is responsible for handling components which are part of the current project.
                Plugins/Components which are installes into Qt are handled by qmlplugindump and the editor's code model.
                See: http://doc.qt.nokia.com/qtcreator-2.3/creator-qml-modules-with-plugins.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