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]Unable to deploy the qt quick app on other windows machine.

[Solved]Unable to deploy the qt quick app on other windows machine.

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 2 Posters 1.7k Views 1 Watching
  • 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.
  • adaitabeheraA Offline
    adaitabeheraA Offline
    adaitabehera
    wrote on last edited by
    #1

    I have written a qt quick 2 application which is not running in any windows machine that has not been installed with Qt 5. It runs fine if run on the same machine where qt is installed. I am using Qt 5.0.1. I have shared the images of my release folder and plugins below:

    https://docs.google.com/file/d/0B9X1_s7_0KjEeTFkYmc5QjlablU/edit?usp=sharing
    https://docs.google.com/file/d/0B9X1_s7_0KjEUTRpb3R4M3RCRWM/edit?usp=sharing

    Below is my main function: SingleApplication is a subclass of QApplication for single instance app.

    @int main(int argc, char *argv[])
    {
    int returnVal = 0;
    SingleApplication app(argc, argv, SIMULATOR_SINGLE_INSTANCE);

    if(app.isRunning())
    {
        app.sendMessage("another instance exited...");
        return 0;
    }
    
    QtQuick2ApplicationViewer viewer;
    viewer.setMainQmlFile(QStringLiteral("qml/main.qml"));
    QQmlContext *pContext = viewer.engine()->rootContext();
    
    QStringList strLibPaths = SingleApplication::libraryPaths();
    strLibPaths << SingleApplication::applicationDirPath(&#41;+"/plugins";
    SingleApplication::setLibraryPaths(strLibPaths);
    
    strLibPaths = viewer.engine()->importPathList();
    strLibPaths << SingleApplication::applicationDirPath()+"/plugins";
    viewer.engine()->setImportPathList(strLibPaths);
    
    viewer.show();
    viewer.setMaximumSize(viewer.initialSize());
    viewer.setMinimumSize(viewer.initialSize());
    
    QDesktopWidget *pDesktopWdiget = QApplication::desktop();
    QRect rectAvailable = pDesktopWdiget->availableGeometry();
    int iX = rectAvailable.x() + ((rectAvailable.width() - viewer.size().width())/2);
    int iY = rectAvailable.y() + ((rectAvailable.height() - viewer.size().height())/2);
    viewer.setPosition(iX, iY);
    
    returnVal = app.exec(&#41;;
    qDebug("returning..."&#41;;
    return returnVal;
    

    }@

    Please help me fixing any mistake I am making here.

    C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg. -- Bjarne Stroustrup

    1 Reply Last reply
    0
    • W Offline
      W Offline
      weiyuemin
      wrote on last edited by
      #2

      You application can't run, so what is the error it shows? Or just nothing happend after you run it?

      Try copy all the dlls to the destination machine?

      1 Reply Last reply
      0
      • adaitabeheraA Offline
        adaitabeheraA Offline
        adaitabehera
        wrote on last edited by
        #3

        I have already copied the dependent dlls. If I remove any of the dependent dll, it shows error about the missing dll. But when all dlls are present, there is no error, just the application process name appears in task manager for few seconds and then disappears.

        C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg. -- Bjarne Stroustrup

        1 Reply Last reply
        0
        • adaitabeheraA Offline
          adaitabeheraA Offline
          adaitabehera
          wrote on last edited by
          #4

          I resolved this issue. The app expects the following folders-->files to be in same path as the executable.

          platforms(folder) -->qwindows.dll
          QtQuick.2(floder)-->plugins.qmltypes, qmldir, qtquick2plugin.dll

          C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg. -- Bjarne Stroustrup

          1 Reply Last reply
          0
          • W Offline
            W Offline
            weiyuemin
            wrote on last edited by
            #5

            Oh, Yes.

            I'm quite not adapted to this at first.

            Not only these two folders, some other folders may also be needed if you use the corresponding feature. These dlls are dynamic loaded, so it doesn't show error when missing these plugin dlls.

            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