Qt World Summit: Submit your Presentation

Qt Quick Controlls 2 Deploying troubles

  • Hello! I'm trying to deploy a Qt Quick Controlls 2 application with material style. I've complied my program and then added all the necessary dlls to it by using windeployqt.exe with argument -qmldir. However, when I'm trying to run it on my second pc, it's not working at all. The dependency Walker and Qt docs didn't help me 😕
    Can someone help me?

    Thanks in advance!

  • Could you post some more details? In what way is it "not working"? What is the output of windeployqt? How does the deployment tree (especially the qml-tree is interesting) look like?

  • I mean, when I'm trying to run my app, nothing happens. The proces still exists. I can see that in task manager. I had the same issue back then with Qt quick Controlls. That problem was missing filles from C:/qt/5.x/qml

    Logs from deployqt: http://pastebin.com/sHe6SEWk
    .pro file: http://pastebin.com/4exHHE1z
    main.cpp: http://pastebin.com/1JM3LqaQ
    main.qml: http://pastebin.com/LwTiGLnJ

  • C:\Qt\5.7\mingw53_32>windeployqt --qmldir C:\Qt\5.7\mingw53_32\qml C:\Users\Maciek\Desktop\xxx

    You should pass your application's QML directory, not Qt's QML directory, to windeployqt.

  • Omg! Thanks bro!

  • Just to elaborate the problem a bit for those who stumble upon the thread while searching for help with deployment issues...

    windeployqt runs a tool called qmlimportscanner that scans through the application's QML files to detect all imported QML modules. Therefore it is important to pass the directory that contains the application's QML sources, so that the deployment tool knows which QML modules must be deployed. Passing Qt's QML installation directory makes the tool scan through the entire Qt installation tree of QML modules. In theory, this should have also worked, since it deploys almost every single QML module that is installed there. However, windeployqt had a little bug in Qt 5.7.0 (fixed in 5.7.1), causing it to deploy only either QtQuick.Controls 1.x or 2.x instead of both. While scanning the QML installation tree, the deployment tool found both imports, but deployed only the first match (1.x). Since the attached application does not import both major versions, passing the correct QML directory is enough to circumvent the problem. As a bonus, it does not end up deploying tons of unnecessary QML modules. ;)

  • @jpnurmi You safe my life bro <3