Qt5 QML module is not installed

前端 未结 5 2056
温柔的废话
温柔的废话 2020-12-24 13:50

I\'m confused about modules in Qt QML. I\'ve read all the docs, but it doesn\'t make clear some basic ideas.

I understand that i can put a bunch of QML files into a

5条回答
  •  被撕碎了的回忆
    2020-12-24 14:39

    I had the same problem and have now fixed it. I found a QML plugin for iOS. There are several things that need to be taken care of:

    1. The plugin pro file needs an addition:

    uri = IosTestPulgin

    # this for error:
    # static plugin for module “QtQuick” with name “IosTestPulgin” 
    # has no metadata URI
    QMAKE_MOC_OPTIONS += -Muri=$$uri
    
    # thanks from:https://github.com/wang-bin/QtAV/issues/368
    

    2. The QML plugin qmldir file needs an additional line like this:

    classname IosqmlpluginPlugin
    # for ERROR: Plugin iostestqmlplugin is missing a classname entry,
    # please add one to the qmldir file.
    # look for qt document http://doc.qt.io/qt-5.6/qtqml-modules-qmldir.html
    

    3 The client project pro file needs an addition like this:

    ios {
        IOSTestPlugin_BUNDLE.files += $$files($$[QT_INSTALL_QML]/IosTestPulgin/qmldir)
        IOSTestPlugin_BUNDLE.path =  IosTestPulgin
        QMAKE_BUNDLE_DATA += IOSTestPlugin_BUNDLE
    }
    # for ios error: module is not installed
    # this means external qml static plugin must add the plugin dir by manual
    # in the app root dir
    

提交回复
热议问题