[SOLVED] Qml Deployment Problem



  • Hi!
    I built static version of Qt 5.3.2 mingw 4.8, but qml application works only on developer`s computer.

    Running under Windbg on other computers gave this errors:
    @QQmlApplicationEngine failed to load component
    qrc:/main.qml:1 module "QtQuick" is not installed
    qrc:/main.qml:2 module "QtQuick.Window" is not installed@

    What should I to do to solve it?

    My .pro file:
    @TEMPLATE = app

    QT += qml quick
    QT += serialport

    SOURCES += main.cpp
    ../Bluetooth/bluetoothprovider.cpp
    ../Bluetooth/moduleprocess.cpp

    RESOURCES += qml.qrc

    Additional import path used to resolve QML modules in Qt Creator's code model

    QML_IMPORT_PATH =

    Default rules for deployment.

    include(deployment.pri)

    HEADERS +=
    ../Bluetooth/bluetoothprovider.h
    ../Bluetooth/moduleprocess.h@

    And main.cpp:
    @#include <QGuiApplication>
    #include <QQmlApplicationEngine>
    #include <QtQml>

    #include "../Bluetooth/bluetoothprovider.h"
    #include "../Bluetooth/moduleprocess.h"

    int main(int argc, char *argv[])
    {

    qmlRegisterType<BluetoothProvider>("com.ivware16.components", 1, 0, "BluetoothProvider");
    qmlRegisterType<ModuleProcess>("com.ivware16.components", 1, 0, "ModuleProcess");
    
    QGuiApplication app(argc, argv);
    QQmlApplicationEngine engine;
    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
    return app.exec&#40;&#41;;
    

    }@



  • Well, possible solution is

    1. Use QQuickView instead of QQmlApplicationEngine
    2. For static build create "QtQuick.2" dir with "qmldir" file and this content:
      @module QtQuick
      plugin qtquick2plugin
      classname QtQuick2Plugin
      typeinfo plugins.qmltypes@

Log in to reply
 

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