Static linking of custom QtQuick plugins

  • Hi

    I have written a bunch of QtQuick plugins that I need to statically link on iOS. I believe I do everything correctly, the lib is linked successfully, because I can use it in C++, but when trying to import it in QML, I get:

    bq. static plugin for module "QtQuick" with name "VLTCorePlugin" has no metadata URI

    And that is correct, when I print out metaData of my plugin
    @qDebug() << qt_static_plugin_VLTCorePlugin().metaData();@

    Then I get:

    bq. QJsonObject({"IID": "VLTCore","className": "VLTCorePlugin","debug": true,"version": 328193})

    No "uri" in there. But how can I add it?

    Just to check, I printed out the metadata of QtQuick plugin itself, and indeed there is a "uri":

    bq. QJsonObject({"IID": "org.qt-project.Qt.QQmlExtensionInterface/1.0","MetaData": {},"className": "QtQuick2Plugin","debug": true,"uri": ["QtQuick.2"],"version": 328193})

  • I found out where the URI is set in essential plugins, it's set by custom variable TARGETPATH that ends up in

    @QMAKE_MOC_OPTIONS += -Muri=$$URI@

    in the file

    bq. qtbase/mkspecs/features/qml_plugin.prf:31

    If qmake MOC options is the right way to do it, it must be written in the documentation, i guess?

    When I add it to my plugin's *.pro file, it works at least.

  • Thank you very much this still works and is needed to get QtQuick plugins working on iOS.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.