WebAssembly - 'QtQuick.Shapes' could not be loaded successfully
-
I have noticed that with WebAssembly (5.13.0) the Shapes module doesn't seem to work.
I have created a basic test wasm app that requires QtQuick.Shapes and although the app builds with emscripten perfectly fine, when running the app all I get is a blank browser window and in the browser console am advised that 'QtQuick.Shapes' could not be loaded.
Is there something extra that needs to be done the get QtQuick.Shapes to work in WASM?
I have tested many other QML features is WASM and they all seem to work surprisingly good, it would be disappointing if Shapes isn't possible though.Thanks in advance for any advise.
-
The Shapes component depends on the multi-threaded feature, which is still experimental in WebAssembly.
The default build for Qt WebAssembly is nonthreaded. -
ahh thanks @lorn-potter that makes sense then.
The actual browser console error is: QtQuick.Shapes" is not installed.
I have the very latest version of emscripten installed and this is what I used to build webassembly support for Qt on my Mac.
As I understand it this should allow me to enables multi-threading (although experimental).Do you happen to know how I can enable multi-threading in emscripten so I can test this though QT's Wasm compilation?
-
It seems that they should work on wasm builds. Here is a change to enable them:
https://codereview.qt-project.org/c/qt/qtdeclarative/+/266295 -
@lorn-potter fantastic.
Thanks for your time to help. I'll make the change and rebuild wasm target and try again and see how I go.
Appreciate the help.
-
@lorn.potter said in WebAssembly - 'QtQuick.Shapes' could not be loaded successfully:
It seems that they should work on wasm builds. Here is a change to enable them:
https://codereview.qt-project.org/c/qt/qtdeclarative/+/266295Just a quick update that this works now with the change indicated above.
Starting to love QT+WASM.Thanks for your help @lorn-potter