Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-95609

cmake names for qml plugins

    XMLWordPrintable

Details

    Description

      i'm trying to use the cmake targets for qml plugins with statically linked qt. however i'm facing challenges to find out the names of a specific plugin.

      the first issue i'm having is a documentation issue: i did not find out which cmake targets to link to. for c++ classes this is in the docs (e.g. https://doc-snapshots.qt.io/qt6-dev/qbuffer.html), for qml classes it only mentions the import statement (https://doc-snapshots.qt.io/qt6-dev/qml-qtquick-layouts-rowlayout.html)

      the second issue i'm seeing is a lack of consistency among the qml plugins:

      • `Qt.labs.animation` is `Qt6::labsanimationplugin`
      • `Qt.labs.sharedimage` is `Qt6::sharedimageplugin`
      • `Qt.labs.wavefrontmesh` is `Qt6::qmlwavefrontmeshplugin`
      • `QtQml.Models` is `Qt6::modelsplugin`
      • `QtQuick.Controls` is `Qt6::qtquickcontrols2plugin`
      • `QtQuick.Dialogs` correspondst to `Qt6::qtquickdialogsplugin`
      • `QtQuick.Layouts` is `Qt6::qquicklayoutsplugin`
      • `QtQuick.Shapes` is `Qt6::qmlshapesplugin`
      • `QtQuick.Templates` is `Qt6::qtquicktemplates2plugin`
      • `QtQuick.Window` is `Qt6::quickwindow`

      so there are various prefixes ("labs", "qml", "qtquick", "qquick"). sometimes there's a version specifier (with Controls and Templates). usually there's a "plugin" suffix, but not always.

      third issue: the `_init` plugins to auto-load the plugin targets are not pulled in as usage requirement of the plugins. linking qml plugins without auto-loading is quite useless imho

      and last issue: the plugins don't carry dependencies. afaict `QtQml.Models` for example is pulled at dependency (of QtQml and QtQuick). however i explicitly need to link both `Qt6::modelsplugin` and `Qt6::modelsplugin_init` explicitly to resolve the dependency

      i know that the qml import scanner takes care of this under the hood and it's super convenient to use: but it significantly increases the cmake execution times, when using multiple (dozens) of targets, as for each target the import scanner takes 10-15 seconds

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qtbuildsystem Qt Build System Team
              timblechmann tim blechmann
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: