QML in Qt 5.15.2 Webassembly
-
Hi,
I am trying to make QML (with QQuickView) working in Qt 5.15.2, but without success. I cannot create QQuickView since it block the main thread or cannot be created from a background thread.
I know that WASM is a moving platform and the community is already focusing on 6.x, I just want to know, that technically it is possible at all to use QML in Qt 5.15.x WASM, or am I chasing ghosts? (Like it should not work at all)
I found a lot of QML/WASM examples (pizza, slate, Sensortag), but I think they were made with previous EMSDK/Qt versions.
So. is it possible at all?
Thanks,
I. -
It should work, the scenegraph/openglunderqml example which uses QQuickView works fine. How are you configuring Qt?
https://s3.eu-west-2.amazonaws.com/wasm-qt-examples/last/index.html
-
Qt: 5.15.2
EMSDK: 2.0.6./configure -xplatform wasm-emscripten -release -static
-prefix /usr/local/QTWASM2
-nomake tests -nomake examples
-no-dbus -no-headersclean
-no-warnings-are-errors
-skip location
-skip qtmultimedia
-skip qtquick3d
-opensource -confirm-license
-feature-thread
-no-feature-tooltip
-feature-openssl
-openssl-linked
-I$ROOT/openssl
-I$ROOT/openssl/include
-L$ROOT/openssl -
Tested:
EMSDK 1.38.9: OpenSSL cannot be compiled, since the packed gcc is older than requested
EMSDK 1.39.16: Could compile but become frozen.
EMSDK 2.0.6: Compiled, but every time I add QQuickView *view = new QQuickView(), the console log says:-- constructing QQuickView
qtloader.js:382 Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-
on-the-main-browser-threadand the execution hangs.
It is possible that I oversee something, but every other modules are fine: multithreading is running, QGraphicsScene is there and works fine. I have only issue with this QML part.