Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Error running a deployed Qt application that makes use of QQuickWidget.

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

Scheduled Pinned Locked Moved Solved QML and Qt Quick
5 Posts 3 Posters 1.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • napajejenunedk0N Offline
    napajejenunedk0N Offline
    napajejenunedk0
    wrote on last edited by napajejenunedk0
    #1

    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.

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      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).

      1 Reply Last reply
      2
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

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

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        napajejenunedk0N 1 Reply Last reply
        2
        • SGaistS SGaist

          Hi,

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

          napajejenunedk0N Offline
          napajejenunedk0N Offline
          napajejenunedk0
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0
          • napajejenunedk0N Offline
            napajejenunedk0N Offline
            napajejenunedk0
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved