Skip to content

Qt for WebAssembly

Specific issues when using Qt for WebAssembly

455 Topics 1.8k Posts
  • WebAssembly error/bug ?! float unrepresentable in integer range

    3
    0 Votes
    3 Posts
    2k Views
    lorn.potterL
    BINARYEN_TRAP_MODE=clamp has been part of Qt WebAssembly since before is was integrated into Qt proper. Look at: mkspecs/wasm-emscripten/qmake.conf It is not needed for WASM_OBJECT_FILES, which is now the default, so it was removed in the 5.15 series. There was a typo (a missing + in +=) for a while that stopped it from actually being used
  • How to use gzip in WASM qt?

    Unsolved
    1
    0 Votes
    1 Posts
    461 Views
    No one has replied
  • How to do callbacks/slots in Qt for WebAssembly?

    Solved
    7
    0 Votes
    7 Posts
    1k Views
    lorn.potterL
    @Edwin-F WebSockets are two way communication, but only a client process can run on WebAssembly/browser. https://doc.qt.io/qt-5/qtwebsockets-index.html
  • Qt webassembly and Layouts

    Solved glitch layouts webassembly viewtable c++
    5
    0 Votes
    5 Posts
    1k Views
    A
    Found the problem: I had installed Qt v 6.0.0 with emscripten 1.39.8. documents say 1.39.8 should work with Qt v5.15.0. Works after installing the correct Qt version.
  • Qt Webassembly with WASI (lucet, wasmtime)?

    Solved
    3
    0 Votes
    3 Posts
    680 Views
    A
    Thank you.
  • Custom c++ main arguments in qtloader.js

    Solved webassembly emscripten
    2
    0 Votes
    2 Posts
    765 Views
    M
    Problem solved by removing the emrun flag. I can now specify custom arguments in the qtloader.js using emscripten's Module.arguments like this : Module['arguments'] = ['FirstArg', 'SecondArg'];
  • WebAssembly and remote objects module

    Solved
    2
    0 Votes
    2 Posts
    425 Views
    lorn.potterL
    WebAssembly as a platform, does not have native support for servers (same as javascript). Emscripten does support using servers via proxy, but that requires a real server. As well, Qt WebAssembly does not yet support emscripten tcp proxy as it requires to run main() in a webworker and pass graphical data to the main thread for canvas access.
  • No rule to make target .... libqtmain.a

    Unsolved
    4
    1 Votes
    4 Posts
    970 Views
    Y
    Are you using Qt Creator? Try changing the emcc compiler config's abi to asmjs-unknown-unknown-emscripten-32bit. @fhryilmaz @winsvu @GaryT
  • Save and access cookies from WebAssembly

    Unsolved
    2
    0 Votes
    2 Posts
    904 Views
    lorn.potterL
    You could use cookies from the javascript side: https://emscripten.org/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.html
  • Problem with QT Creator 4.13.2 auto detect emscripten 1.39.8

    Solved
    2
    0 Votes
    2 Posts
    516 Views
    G
    The problem was related to having a previous version installed. The .emscripten file was not updated during the install of emscripten 1.39.8 to reflect the new version. Once I correct it, QT Creator detected the installed version (1.39.8) . I was able to build and run a simple program. However, QT Creator still generate a couple of warnings.
  • 3d in WebAssembly

    Solved
    2
    0 Votes
    2 Posts
    684 Views
    lorn.potterL
    WebGL is based on opengl es2, WebGL 2 is based on opengl es3. Emsripten (and therefor Qt WebAssembly) has support for both. Thread support in wasm is still experimental, there are limitations.
  • Porting desktop app to WebAssembly: Good pattern to replace QDialog::exec() calls?

    Unsolved
    3
    0 Votes
    3 Posts
    880 Views
    JonBJ
    @lorn-potter Hi there. I know Qt WebAssembly is a work-in-progress. Is there a current (preferably "definitive") list anywhere of what does not work from Qt which we can read/refer other questioners to? Otherwise we seem to wait for you to pop in here! :)
  • Is there any working installer / setup for Windows?

    Unsolved
    6
    0 Votes
    6 Posts
    922 Views
    lorn.potterL
    on Windows, Emscripten uses MinGW as the backend. Emscripten is just python scripts that call system compilers. It uses clang to output wasm binaries. Qt 5.15.x requires Emscripten 1.39.8 To get Qt Creator to use emscripten for wasm, you need the correct version of Emscripten installed and then enable the experimental wasm plugin.
  • pthread send an error (qtloader.js)

    Unsolved
    3
    0 Votes
    3 Posts
    647 Views
    B
    @jsulm I get an exception message when the exec() method (QDrag) is called (toolmaster.h: mousePressEvent). I thought it wad due to the missing multithreading support. This is the error message when I compile it with the default 5.15.1 binaries (console output in Firefox): Uncaught Please compile your program with async support in order to use asynchronous operations like emscripten_sleep
  • Python Backend/QML Frontend Can I Convert To WebAssembly?

    Unsolved
    5
    0 Votes
    5 Posts
    3k Views
    Edwin F.E
    Thanks guys @SGaist and @lorn-potter It seems like it is not really supported at this time and I will have to look into the alternative of putting a layer between the QML and Python backend in C++, essentially becomes a C++ app, but I only want to use C++ as a pass through to the Python somehow using PyBind11...I will try to see if that will work.
  • relative path to external resource

    Unsolved
    2
    0 Votes
    2 Posts
    745 Views
    lorn.potterL
    @SyntaX You would need to preload the files at compile time. https://emscripten.org/docs/tools_reference/emcc.html#emcc-preload-file
  • Qt Webasssembly - Pass URL parameter to QML

    Solved
    4
    0 Votes
    4 Posts
    2k Views
    SyntaXS
    This solution works fine for get parameter, I was wondering if this is possible for post too? Or is there another solution to this, so I don't have to show the parameter directly in the address ?
  • Unable to run an example using MQTT

    Solved
    5
    0 Votes
    5 Posts
    849 Views
    N
    Hi @JKSH , Now it's clear enough what I have to do, then I will try to build the source code for Qt WebAssembly and generate the necessary set of libraries. I appreciate your help on this! Thanks.
  • How to use SQLite in Qt WebAssembly

    Unsolved
    3
    0 Votes
    3 Posts
    1k Views
    S
    @JonB I know Qtsql module not supported in Wasm. i believe wasm supports virtual file system and tried QFile read and write operation. why Qt still not support for SQL? even i need Sqlite should work on wasm. @lorn-potter can you please answer for this? thanks,
  • QMQTT run error on Qt for WebAssembly?

    Unsolved
    1
    0 Votes
    1 Posts
    317 Views
    No one has replied