QML Deployment on Windows doesn't show any window



  • I have a QtQuick application written in Qt5.10.1. It works fine withing QtCreator.
    My QML files are placed into a Resources.qrc. Now I'm using windeployqt to retrieve all the relevant dependencies.

    First question: the doc page says:

    If your application uses Qt Quick, run:
    windeployqt --qmldir <path-to-app-qml-files> <path-to-app-binary>

    I still need to use --qmldir even my QML files are placed into resources?

    I also added the following libraries: opengl qml quick quickwidgets.
    But when I launch the application nothing is shown and checking from process manager I can see my program there.

    Launching from console no output is also shown - the prompt returns immediately (and the program is still loaded in memory).

    What am I missing?


  • Moderators

    @Mark81 said in QML Deployment on Windows doesn't show any window:

    I still need to use --qmldir even my QML files are placed into resources?

    Yes.


  • Moderators

    @Mark81 said in QML Deployment on Windows doesn't show any window:

    But when I launch the application nothing is shown and checking from process manager I can see my program there.
    Launching from console no output is also shown - the prompt returns immediately (and the program is still loaded in memory).
    What am I missing?

    It's been a few years since I last used Windows, so I'm only guessing. To me it seems likely that plugins have not been deployed, namely the qwindows.dll plugin. Libraries are probably deployed correctly because otherwise Windows prints a nice message ("failed to load X library").



  • The platform plugin is there.
    Here my complete command:

    windeployqt -network -opengl -qml -quick -quickwidgets  --qml
    dir . --libdir ./dist --plugindir ./dist myapp.exe
    

    and here the output files:

    |   myapp.exe
    |   D3Dcompiler_47.dll
    |   libEGL.dll
    |   libgcc_s_dw2-1.dll
    |   libGLESV2.dll
    |   libstdc++-6.dll
    |   libwinpthread-1.dll
    |   opengl32sw.dll
    |   qhttp.dll
    |   Qt5Core.dll
    |   Qt5Gui.dll
    |   Qt5Network.dll
    |   Qt5OpenGL.dll
    |   Qt5Qml.dll
    |   Qt5Quick.dll
    |   Qt5QuickControls2.dll
    |   Qt5QuickTemplates2.dll
    |   Qt5QuickWidgets.dll
    |   Qt5Svg.dll
    |   Qt5Widgets.dll
    |
    +---bearer
    |       qgenericbearer.dll
    |
    +---iconengines
    |       qsvgicon.dll
    |
    +---imageformats
    |       qgif.dll
    |       qicns.dll
    |       qico.dll
    |       qjpeg.dll
    |       qsvg.dll
    |       qtga.dll
    |       qtiff.dll
    |       qwbmp.dll
    |       qwebp.dll
    |
    +---platforms
    |       qwindows.dll
    |
    +---qmltooling
    |       qmldbg_debugger.dll
    |       qmldbg_inspector.dll
    |       qmldbg_local.dll
    |       qmldbg_messages.dll
    |       qmldbg_native.dll
    |       qmldbg_nativedebugger.dll
    |       qmldbg_profiler.dll
    |       qmldbg_quickprofiler.dll
    |       qmldbg_server.dll
    |       qmldbg_tcp.dll
    |
    +---styles
    |       qwindowsvistastyle.dll
    |
    \---translations
            qt_ar.qm
            qt_bg.qm
            qt_ca.qm
            qt_cs.qm
            qt_da.qm
            qt_de.qm
            qt_en.qm
            qt_es.qm
            qt_fi.qm
            qt_fr.qm
            qt_gd.qm
            qt_he.qm
            qt_hu.qm
            qt_it.qm
            qt_ja.qm
            qt_ko.qm
            qt_lv.qm
            qt_pl.qm
            qt_ru.qm
            qt_sk.qm
            qt_uk.qm
    

  • Qt Champions 2017

    Hi
    Just as a sanity check / note:
    The PC where nothing shows up.
    its openGL are up and running and verified to work ?
    I had an intel HD laptop where openGL app just hanged when started.
    Upgrading driver fixed it.



  • @mrjj said in QML Deployment on Windows doesn't show any window:

    The PC where nothing shows up.
    its openGL are up and running and verified to work ?

    How to check this in a reliable way? Running inside QtCreator is not enough?


  • Qt Champions 2017

    @Mark81
    Oh, i though it was other pc. misread :)
    Yep, driver wise is should be good enough test if runs in Creator.


  • Lifetime Qt Champion

    Hi,

    Are you building inside your sources ?

    If not, then you don't pass the correct path to the --qmldir option.



  • Ok, now I understand. You're saying I have to set the --qmldir path to the source directory where my .qml files actually are. I didn't understand that and I was looking for binaries, hence I was passing the output directory because they are embedded in the executable as resources.

    I will try that and report back the results.



  • Yes. It did the trick. Thanks,


Log in to reply
 

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