QtWebEngine and QtWebChannel deployment issue
-
I'm having issues running an app after deploying it in windeployqt, while it runs fine in the QtCreator.
Working on Windows 10, Qt 5.9.
I have a qml file called WebRecorder that imports QtWebEngine and QtWebChannel. When I run this in QtCreator, this works without issue:
import QtQuick 2.0 import QtWebEngine 1.15 import QtWebChannel 1.10 import QtMultimedia 5.9
To deploy, I run the the following command:
C:\path>C:\Qt\5.9.9\msvc2017_64\bin\windeployqt --qmldir ..\..\src\app app.exe
The app builds fine, but when I start it up it crashes on the following errors:
qrc:/common/components/cameras/WebRecorder.qml:3 module "QtWebChannel" is not installed qrc:/common/components/cameras/WebRecorder.qml:2 module "QtWebEngine" is not installed qrc:/common/components/cameras/WebRecorder.qml:3 module "QtWebChannel" is not installed qrc:/common/components/cameras/WebRecorder.qml:2 module "QtWebEngine" is not installed
I've tried adding "QT += webengine webchannel" to my .pro file, no luck there. Also tried different versions of the modules, nothing.
I can see that both Qt5WebEngine.dll and QtWebChannel.dll are in the out folder, so that's something.Would appreciate any suggestions!
-
@carlyh
the "--qmldir" parameter should point to the directory containing your qml files.
You can simply point it to your projects root directory -
@raven-worx Thanks for the suggestion! Just tried that, no dice.
I'm working on updating this project to 5.15, and have seeing the same issue with that version as well...
-
I have seen others mention on various forum threads that they point
--qmldir
to the root of where the entire Qt QML distribution exists, as in:--qmldir C:\destination\dl_third_party\Qt_desktop\5.14.0\msvc2017_64\qml
This has the side-effect (which can be "good" or "bad" depending on your opinion) of shipping ALL of Qt's QML into your deployed app (even parts of the Qt QML distro that your app does not need).
As I understand it, this "kitchen sink" approach bypasses whatever issue is preventing windeployqt from properly analyzing your app for its minimum needed amount of Qt QML. We bypass the problem by just deploying all QML known to humankind, essentially.