Skip to content

Qt for WebAssembly

Specific issues when using Qt for WebAssembly

453 Topics 1.8k Posts
QtWS25 Last Chance
  • Render HTML in Qt WebAssembly

    Unsolved 1 Sept 2020, 08:56
    0 Votes
    1 Posts
    312 Views
    No one has replied
  • 0 Votes
    2 Posts
    611 Views
    I found out that the QtWebEngine module is indeed not available and instead QtWebView is available. After replacing WebEngineView with WebView, the compiling error is gone and the program compiles. But yes QtWebview is unsupported as it is integrated with QtWebengineView
  • Accessing files on the "server side"?

    Unsolved 30 Aug 2020, 21:40
    0 Votes
    2 Posts
    365 Views
    @RogueWarrior no experience with webassembly, but by creating and running a Qt app on the embedded device, you could leverage access via any VNC client using the VNC platform plugin i.e. ./yourQtApp -platform vnc
  • HelloWorld Wasm build problem

    Solved 3 May 2020, 15:37
    0 Votes
    8 Posts
    1k Views
    @Amin-Ya Would you please specify what exactly you are referring to when you are saying the C++ path? I seem to be having the same problem here.
  • PROXY_TO_PTHREAD Support

    Unsolved 24 Aug 2020, 13:41
    0 Votes
    3 Posts
    750 Views
    @jsulm thank you for the answer. That might work indeed, but the thing is the same application works on Windows, iOS, Mac, Android, and Linux. I'd have to change the logic just to make it work with Wasm. I could easily run non-Qt application simply by proxifying the call to main, is there a way to get that to work with Qt5 apps?
  • 0 Votes
    10 Posts
    3k Views
    @Ahmed-Yarub-Hani-Al-Nuaimi Oh ok I see, thanks for your time !
  • play rtsp stream in WebAssembly

    Unsolved 7 Aug 2020, 06:07
    0 Votes
    1 Posts
    436 Views
    No one has replied
  • Build simple QML on WebAssembly

    Solved 31 Jul 2020, 12:52
    0 Votes
    2 Posts
    1k Views
    @kirill_f Problem solved. I just installed upstream version of emscrypten instead of fastcomp. emsdk install sdk-upstream-1.39.8-64bit emsdk activate sdk-upstream-1.39.8-64bit
  • This topic is deleted!

    Unsolved 31 Jul 2020, 13:07
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • Is the Qt WASM module linked into a project binary?

    Unsolved 24 Jul 2020, 11:41
    0 Votes
    1 Posts
    229 Views
    No one has replied
  • Qt Lottie on WebAssembly

    Unsolved 12 Jul 2020, 18:48
    0 Votes
    2 Posts
    470 Views
    I am not even sure how supported QtLottie is on the desktop, but not yet supported for Qt WebAssermbly. I do know that the Qt WebAssembly platform has a few issues like this regarding QLogging and Q_DECLARE_LOGGING_CATEGORY that do not happen on desktop, as we are built statically linked.
  • Export *.xlsx or *.ods in Qt WebAssembly

    Unsolved 15 Jul 2020, 17:35
    0 Votes
    7 Posts
    1k Views
    There is file access, both locally and for the system. Since WebAssembly lives in the browsers javascript sandbox, to access file content on the system, outside of the browser, we created QFileDialog::getOpenFileContent and QFileDialog::saveFileContent https://doc.qt.io/qt-5/qfiledialog.html#getOpenFileContent Also, there should be persistent files, but it's a bit broken at the moment in all the releases.
  • float unrepresentable in integer range

    Unsolved 18 Jul 2020, 11:52
    0 Votes
    2 Posts
    395 Views
    What version of Qt and what version of Emscripten are you using?
  • How to read QueryString params

    Solved 9 Jul 2020, 22:11
    0 Votes
    3 Posts
    530 Views
    Hi @lorn-potter . Sorry for my super late reply. Your message was spot on. Not only that but it helped me understand some stuff about wasm that I wasn't very clear about. I did some changes and I got my app up and running with no issues. This is awesome. I'm loving Qt more and more everyday. Thank you very much and warm regards!
  • 0 Votes
    8 Posts
    1k Views
    Thanks for the update. When can we expect this merged? Also why was QNetworkRequest::DefaultTransferTimeoutConstant used for default value? In the documentation https://doc.qt.io/qt-5/qnetworkrequest.html#setTransferTimeout if the function was never called the actual default value is stated to be 0 which is equal to no time limit. DefaultTransferTimeoutConstant is just used as default value if the function was called without any arguments.
  • record audio in WebAssembly

    Solved 29 Jun 2020, 10:15
    0 Votes
    3 Posts
    582 Views
    @lorn-potter Thank you.I use OpenAL and it works for me.
  • Associate QT WebAssembly with emscripten

    Unsolved 25 Jun 2020, 09:00
    0 Votes
    5 Posts
    796 Views
    QtCreator does not have full support for using emscripten, unless you use Qt 5.15. Even then it is still experimental and you need to enable the WebAssembly plugin from within QtCreator first. It's just easier to build using the commandline.
  • 1 Votes
    2 Posts
    1k Views
    Short answer... you can't get the full file path of a file. Your question is more related to safety/security standards regarding major browsers and the decisions related to them made by owner companies/foundations. That is, javascript is not allowed to know the full path of a file shared by the user. So, fileContentReady or in general any webassembly function will end up being a javascript function, limited to the security standards imposed on js implementation by the browser. (You can always ask the user to install a java applet :P )
  • 0 Votes
    6 Posts
    3k Views
    @lorn-potter I have installed emsdk using ./emsdk install sdk-fastcomp-1.38.27-64bit ./emsdk activate sdk-fastcomp-1.38.27-64bit bcz installation fails(Error : No such tool/sdk) with ./emsdk install sdk-1.38.16-64bit and using online installer as well as offline static build am getting same error for simple Qt Application build error log kmb@ubuntu:~/Work/FEB2020/TestApp/build$ /home/kmb/Qt/5.14.0/wasm_32/bin/qmake .. Info: creating stash file /home/kmb/Work/FEB2020/TestApp/build/.qmake.stash kmb@ubuntu:~/Work/FEB2020/TestApp/build$ make em++ -c -pipe -O3 -std=gnu++11 -s ALLOW_MEMORY_GROWTH=1 -Wall -Wextra -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I../../TestApp -I. -I../../../../Qt/5.14.0/wasm_32/include -I../../../../Qt/5.14.0/wasm_32/include/QtQuick -I../../../../Qt/5.14.0/wasm_32/include/QtGui -I../../../../Qt/5.14.0/wasm_32/include/QtQmlModels -I../../../../Qt/5.14.0/wasm_32/include/QtQml -I../../../../Qt/5.14.0/wasm_32/include/QtNetwork -I../../../../Qt/5.14.0/wasm_32/include/QtCore -I. -I/home/kmb/.emscripten_ports/openssl/include -I../../../../Qt/5.14.0/wasm_32/mkspecs/wasm-emscripten -o main.o ../main.cpp em++ -c -pipe -O3 -std=gnu++11 -s ALLOW_MEMORY_GROWTH=1 -Wall -Wextra -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I../../TestApp -I. -I../../../../Qt/5.14.0/wasm_32/include -I../../../../Qt/5.14.0/wasm_32/include/QtQuick -I../../../../Qt/5.14.0/wasm_32/include/QtGui -I../../../../Qt/5.14.0/wasm_32/include/QtQmlModels -I../../../../Qt/5.14.0/wasm_32/include/QtQml -I../../../../Qt/5.14.0/wasm_32/include/QtNetwork -I../../../../Qt/5.14.0/wasm_32/include/QtCore -I. -I/home/kmb/.emscripten_ports/openssl/include -I../../../../Qt/5.14.0/wasm_32/mkspecs/wasm-emscripten -o testapp.js_plugin_import.o /home/kmb/Work/FEB2020/TestApp/build/testapp.js_plugin_import.cpp em++ -c -pipe -O3 -std=gnu++11 -s ALLOW_MEMORY_GROWTH=1 -Wall -Wextra -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I../../TestApp -I. -I../../../../Qt/5.14.0/wasm_32/include -I../../../../Qt/5.14.0/wasm_32/include/QtQuick -I../../../../Qt/5.14.0/wasm_32/include/QtGui -I../../../../Qt/5.14.0/wasm_32/include/QtQmlModels -I../../../../Qt/5.14.0/wasm_32/include/QtQml -I../../../../Qt/5.14.0/wasm_32/include/QtNetwork -I../../../../Qt/5.14.0/wasm_32/include/QtCore -I. -I/home/kmb/.emscripten_ports/openssl/include -I../../../../Qt/5.14.0/wasm_32/mkspecs/wasm-emscripten -o testapp.js_qml_plugin_import.o /home/kmb/Work/FEB2020/TestApp/build/testapp.js_qml_plugin_import.cpp /home/kmb/Qt/5.14.0/wasm_32/bin/rcc -name qml ../qml.qrc -o qrc_qml.cpp em++ -c -pipe -O3 -std=gnu++11 -s ALLOW_MEMORY_GROWTH=1 -Wall -Wextra -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I../../TestApp -I. -I../../../../Qt/5.14.0/wasm_32/include -I../../../../Qt/5.14.0/wasm_32/include/QtQuick -I../../../../Qt/5.14.0/wasm_32/include/QtGui -I../../../../Qt/5.14.0/wasm_32/include/QtQmlModels -I../../../../Qt/5.14.0/wasm_32/include/QtQml -I../../../../Qt/5.14.0/wasm_32/include/QtNetwork -I../../../../Qt/5.14.0/wasm_32/include/QtCore -I. -I/home/kmb/.emscripten_ports/openssl/include -I../../../../Qt/5.14.0/wasm_32/mkspecs/wasm-emscripten -o qrc_qml.o qrc_qml.cpp sed -e s/@APPNAME@/TestApp/g /home/kmb/Qt/5.14.0/wasm_32/plugins/platforms/wasm_shell.html > /home/kmb/Work/FEB2020/TestApp/build/TestApp.html cp -f /home/kmb/Qt/5.14.0/wasm_32/plugins/platforms/qtloader.js /home/kmb/Work/FEB2020/TestApp/build cp -f /home/kmb/Qt/5.14.0/wasm_32/plugins/platforms/qtlogo.svg /home/kmb/Work/FEB2020/TestApp/build em++ -s WASM=1 -s FULL_ES2=1 -s USE_WEBGL2=1 -s NO_EXIT_RUNTIME=0 -s ERROR_ON_UNDEFINED_SYMBOLS=1 --bind -O3 -s ALLOW_MEMORY_GROWTH=1 -o ./TestApp.js main.o testapp.js_plugin_import.o testapp.js_qml_plugin_import.o qrc_qml.o /home/kmb/Qt/5.14.0/wasm_32/plugins/platforms/libqwasm.a /home/kmb/Qt/5.14.0/wasm_32/lib/libQt5EventDispatcherSupport.a /home/kmb/Qt/5.14.0/wasm_32/lib/libQt5FontDatabaseSupport.a /home/kmb/Qt/5.14.0/wasm_32/lib/libqtfreetype.a /home/kmb/Qt/5.14.0/wasm_32/lib/libQt5EglSupport.a /home/kmb/Qt/5.14.0/wasm_32/plugins/imageformats/libqgif.a /home/kmb/Qt/5.14.0/wasm_32/plugins/imageformats/libqicns.a /home/kmb/Qt/5.14.0/wasm_32/plugins/imageformats/libqico.a /home/kmb/Qt/5.14.0/wasm_32/plugins/imageformats/libqjpeg.a /home/kmb/Qt/5.14.0/wasm_32/plugins/imageformats/libqtga.a /home/kmb/Qt/5.14.0/wasm_32/plugins/imageformats/libqtiff.a /home/kmb/Qt/5.14.0/wasm_32/plugins/imageformats/libqwbmp.a /home/kmb/Qt/5.14.0/wasm_32/plugins/imageformats/libqwebp.a /home/kmb/Qt/5.14.0/wasm_32/qml/QtQuick.2/libqtquick2plugin.a /home/kmb/Qt/5.14.0/wasm_32/qml/QtQuick/Window.2/libwindowplugin.a /home/kmb/Qt/5.14.0/wasm_32/lib/libQt5Quick.a /home/kmb/Qt/5.14.0/wasm_32/lib/libQt5QmlModels.a /home/kmb/Qt/5.14.0/wasm_32/lib/libQt5Qml.a /home/kmb/Qt/5.14.0/wasm_32/lib/libQt5Gui.a /home/kmb/Qt/5.14.0/wasm_32/lib/libqtlibpng.a /home/kmb/Qt/5.14.0/wasm_32/lib/libqtharfbuzz.a /home/kmb/Qt/5.14.0/wasm_32/lib/libQt5Network.a /home/kmb/Qt/5.14.0/wasm_32/lib/libQt5Core.a /home/kmb/Qt/5.14.0/wasm_32/lib/libqtpcre2.a shared:ERROR: '/home/kmb/Qtwasm/emsdk/fastcomp-clang/e1.38.27_64bit/binaryen/bin/asm2wasm ./TestApp.temp.asm.js --total-memory=16777216 --trap-mode=allow -O3 --mem-init=./TestApp.js.mem --mem-base=1024 --wasm-only -o ./TestApp.wasm --mvp-features' failed (-9) Makefile:215: recipe for target 'TestApp.js' failed make: *** [TestApp.js] Error 1 so what is cuase here and i am using Ubuntu 18.04 VM kindly let me root cause
  • Build Error : Qt WebAssembly for Linux (Uubuntu 18.04)

    Unsolved 23 Jun 2020, 04:49
    0 Votes
    2 Posts
    529 Views
    And one more problem is if one of the other basic Qt App gets compiled and build successfully and when i run it using *"emrun .html" using console i am getting application exit error as shown in image [image: eb5f2ad1-d299-4b44-bfdb-68ff30e122ca.png] So what is the reason for getting this.(I am using Firefox browser).