Error running a deployed Qt application that makes use of QQuickWidget.



  • Hello, all.

    Created the simplest Qt Quick application that makes use of the QtQuickWidgets add-on (Qt Modules -> Qt Add-Ons -> Qt Quick Widgets. Here's the code:

    // main.cpp
    // --------
    #include <QApplication>
    #include <QQuickWidget>
    
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
        QQuickWidget w( QUrl( "qrc:/View.qml" ) );
        w.show();
    
        return a.exec();
    }
    
    // View.qml
    // --------
    import QtQuick 2.0
    
    Rectangle {
        id: page
        width: 320; height: 480
        color: "lightgray"
    
        Text {
            id: helloText
            text: "Hello world!"
            y: 30
            anchors.horizontalCenter: page.horizontalCenter
            font.pointSize: 24; font.bold: true
        }
    }
    

    The qml file is embedded into the application's resources. The application is built using Qt 5.5 MSVC12 (VS 2013) 32-bit and is then deployed using the integrated Windows Qt deployment tool - windeployqt. The deployed files are as follows:

    Running the application on the build machine (Windows 8.1 64-bit) that has Qt 5.5 installed results in:

    Copying the folder containing all deployed files to a fresh new virtual machine or a physical one that doesn't have Qt installed but has the
    Visual Studio 2013 C++ 32-bit redistrubutable installed (containing msvcr120.dll and msvcp120.dll) and running the application results in showing the following application window:

    The QtQuick source is intentionally taken from Qt examples to be as simple and as Qt certified as possible. Any guesses what is missing? Added the dlls of all Qt modules and plugins in the folder of the application's executable but this didn't do the trick as well. The complete source of the application can be found here.

    This problem is not reproduced when using QtQuick 1.x (QtDeclarative module) but only when using Qt Quick 2.x.


  • Moderators

    Hi! The image-upload feature on our forum is broken, you might see the images you uploaded but other users don't. Please upload your images to an image hoster of your choice, e.g. https://postimage.io/, and embed them here with the following markup: ![alternate text](url).


  • Lifetime Qt Champion

    Hi,

    Did you pass the path to your .qml files to windeployqt ? That way it can parse them add the corresponding dependencies.



  • @SGaist Haven't previously tried. Adding -qmldir switch with the directory containing the qml file nothing additional was deployed.



  • The problem was that I haven't copied any of the QML and QtQuick plug-ins situated in the qml directory in the Qt framework's installation folder next to the bin, lib and plugins folders. These QML and QtQuick plug-ins should have probably been deployed by the windeployqt application when as @SGaist said the --qmldir switch is used and points to the directory path containing the application's qml files. The deployment of a QtQuick/QML application and the qml folder in particular is discussed here and here.


Log in to reply
 

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