Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to deal with Qt Quick 2 Extension Plugin inside Project Dir?



  • When I run the project, just stuck on

    qrc:/main.qml:4:1: module "com.mycompany.qmlcomponents" is not installed
    

    But during coding, the Qt creator has recognized the plugin and just fine to import.

    here the trace of import plugins:

    QML debugging is enabled. Only use this in a safe environment.
    QQmlImportDatabase::addImportPath: "/opt/Qt5.14.2/5.14.2/gcc_64/qml"
    QQmlImportDatabase::addImportPath: "qrc:/qt-project.org/imports"
    QQmlImportDatabase::addImportPath: "/home/linux/Projects/Project_TryPlugin/SourceCode/build-TryPlugin-Desktop_Qt_5_14_2_GCC_64bit-Debug/src/TryPlugin"
    QQmlImportDatabase::addImportPath: "/home/linux/Projects/Project_TryPlugin/SourceCode/build-TryPlugin-Desktop_Qt_5_14_2_GCC_64bit-Debug/src/MyPlugin"
    QQmlImports(qrc:/main.qml)::addLibraryImport: "QtQuick" 2.12 as ""
    QQmlImports(qrc:/main.qml)::importExtension: loaded "/opt/Qt5.14.2/5.14.2/gcc_64/qml/QtQuick.2/qmldir"
    QQmlImportDatabase::registerPluginTypes: "QtQuick" from "/opt/Qt5.14.2/5.14.2/gcc_64/qml/QtQuick.2"
    QQmlImports(qrc:/main.qml)::addLibraryImport: "QtQuick.Window" 2.12 as ""
    QQmlImports(qrc:/main.qml)::importExtension: loaded "/opt/Qt5.14.2/5.14.2/gcc_64/qml/QtQuick/Window.2/qmldir"
    QQmlImportDatabase::registerPluginTypes: "QtQuick.Window" from "/opt/Qt5.14.2/5.14.2/gcc_64/qml/QtQuick/Window.2"
    QQmlImports(qrc:/main.qml)::addLibraryImport: "com.mycompany.qmlcomponents" 1.0 as ""
    QQmlApplicationEngine failed to load component
    qrc:/main.qml:4:1: module "com.mycompany.qmlcomponents" is not installed
    

    Here the complete source code:
    https://github.com/mangherr769/QtWithQml2ExtensionPlugin

    Does anyone know how to resolve this and make it correctly running on cross-platform?


Log in to reply