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



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



  • 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?



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



  • 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



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


Log in to reply
 

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