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. [Solved] Qt Quick qml widgets in Widget application are missing when deployed?
QtWS25 Last Chance

[Solved] Qt Quick qml widgets in Widget application are missing when deployed?

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 2 Posters 1.8k 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.
  • P Offline
    P Offline
    panch
    wrote on last edited by panch
    #1

    Hi,

    I have a desktop Qt Widget client application, where I have added a qml start/stop button, and added to the layout by doing the following:
    startStopWidget_ = new WidgetStartStop();
    startStopWidget_->setObjectName(QStringLiteral("startStopWidget"));
    startStopWidget_->setResizeMode(QQuickWidget::SizeRootObjectToView);
    startStopWidget_->setSource(QUrl(QStringLiteral("qrc:/res/qml/buttonstartstop.qml")));

    When running the application from anywhere on my development PC, the qml widget is properly displayed. But if I deploy the application to another machine, not having IDE environments installed, the widget is empty. I'm not copying the qml file with the exe file since I assume, that it's part of the resources compiled into the exe. At least on the development PC I don't need to copy the qml file with the exe.

    I'm using mainly the Visual Studio plugin to develop the application.

    Any input is appreciated.

    Thanks

    Carsten

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      Hi @panch,

      How did you deploy your compiled files? Are all the dependencies in place?

      See http://wiki.qt.io/Deploy_an_Application_on_Windows

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • P Offline
        P Offline
        panch
        wrote on last edited by
        #3

        I will have a look at the wiki page you linked to - haven't seen that one before. So I guess that something may be missed there.
        But please enlighten me; if I have added the qml to the resource file, and use the qml by calling qrc:// shouldn't it then be embedded in the exe file?

        That's what I'd assume, because that was the whole point in adding it to the resources. I wouldn't like to deploy qml files with my application...

        JKSHJ 1 Reply Last reply
        0
        • P panch

          I will have a look at the wiki page you linked to - haven't seen that one before. So I guess that something may be missed there.
          But please enlighten me; if I have added the qml to the resource file, and use the qml by calling qrc:// shouldn't it then be embedded in the exe file?

          That's what I'd assume, because that was the whole point in adding it to the resources. I wouldn't like to deploy qml files with my application...

          JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #4

          @panch said:

          But please enlighten me; if I have added the qml to the resource file, and use the qml by calling qrc:// shouldn't it then be embedded in the exe file?

          Yes, that's correct.

          That's what I'd assume, because that was the whole point in adding it to the resources. I wouldn't like to deploy qml files with my application...

          Perhaps you're missing other files required for deployment (I don't mean .qml files)

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          0
          • P Offline
            P Offline
            panch
            wrote on last edited by
            #5

            Hi again,

            The problem has been resolved. What I needed to do was to add a qml-directory in the executable folder of the program, consisting of these 3 folders copied from the Qt install directory:

            • QtGraphicalEffects
            • QtQuick
            • QtQuick.2

            Apart from that, I apparently needed a qt.conf file next to the executable with the following i the file:
            [Paths]
            Prefix=.

            I'm not fully aware, why I need the qt.conf file, since I assumed that the default directory for the qml dll's already was in the same directory as the executable.

            But this works, I'll edit the headline to Solved right away.

            And yes, there is no need for the qml files in the deployed directory.

            Thanks for the help!

            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