Skip to content

Qt for WebAssembly

Specific issues when using Qt for WebAssembly

444 Topics 1.8k Posts
  • Same issue on my side

    Unsolved
    1
    0 Votes
    1 Posts
    202 Views
    No one has replied
  • Missing file wasm_shell.html

    Unsolved
    1
    0 Votes
    1 Posts
    211 Views
    No one has replied
  • Can I use MSVC compiler instead of MinGW for Webassembly?

    Unsolved
    7
    0 Votes
    7 Posts
    879 Views
    P

    @lorn-potter

    Hi, thanks a lot for sharing me detailed description.

    Currently, I am using Qt 5.12.3 and MSVC2017 for our product. If I migrated entire code from Qt 5.12.3 and MSVC2017 to Qt 6 and MSVC2019 then, could I replace MinGW with MSVC 2019 for web assembly related development? If yes, please share the steps for the same and if not, then suggest any other options.

    If I am in wrong path, then please suggest how shall I approach for our solution as well?

    Thanks,
    Pradson

  • build Qt 6.3.0 to generate WebAssembly library framework.

    Solved
    4
    0 Votes
    4 Posts
    1k Views
    RenioR

    I solved! starting from a clean situation:
    I removed the source code using the Qt MaintenanceTool.
    I erased the dirty file contained in Src directory.
    I added the source code using the Qt MaintenanceTool.
    Now in a powershell in windows I ran this command

    .\configure.bat -qt-host-path C:\Qt\6.3.0\mingw_64\ -no-warnings-are-errors -platform wasm-emscripten -prefix %CD%\qtbase

    and followed the instruction in this post.

    [https://forum.qt.io/topic/136045/build-qt6-3-wasm-from-source-configure-error](link url)

    I appliated the patch indicated in this post.

    [https://bugreports.qt.io/browse/QTBUG-103498](link url)

    I ran the compile command

    cmake --build . --parallel.

    The last step, I most execute the installation of the wasm library patched, but I don have idea how

  • 0 Votes
    2 Posts
    220 Views
    lorn.potterL

    qmake still works for apps!

  • Where to get the source for the examples?

    Unsolved
    5
    0 Votes
    5 Posts
    453 Views
    C

    @lorn-potter Are you saying I need to reconfigure and rebuild Qt? I did not build Qt initially. I just got it from the Linux install along with Qt Creator.

  • QSoundEffect for WebAssembly

    Unsolved
    6
    0 Votes
    6 Posts
    594 Views
    P

    Small correction, as others might face the same issue: in more complex application QAudioSink also fails to work (but works when compiled for Windows target). Based on the latest comment by Lorn in the corresponding bug report, Qt Multimedia for WebAssembly requires threaded build. I am trying to get this, will keep this thread posted when more results are available.

  • QWebSocket open not responding with error to invalid URL

    Unsolved
    1
    0 Votes
    1 Posts
    177 Views
    No one has replied
  • Trouble using Asyncify

    Unsolved
    2
    0 Votes
    2 Posts
    428 Views
    lorn.potterL

    Did you configure Qt with -device-option QT_EMSCRIPTEN_ASYNCIFY=1 ?

  • WebAssembly and sound effects

    Unsolved
    17
    0 Votes
    17 Posts
    3k Views
    P

    My apologies, what is the actual current status of Qt Multimedia for WebAssembly?

    For some reason I couldn't make it work for me. I realize this thread is already quite old and may not get noticed soon, so I created a new topic about my issue here:

    https://forum.qt.io/topic/136931/qsoundeffect-for-webassembly

    Thanks,
    Peter

  • how to embed translation files?

    Solved
    4
    0 Votes
    4 Posts
    648 Views
    R

    I'm pretty new to Qt and did not know anything about the resource system :) So I simply googled for qml internationalization and in the results this page seemed appropriate:

    https://doc.qt.io/qt-5/qtquick-internationalization.html

    That one pointed to the Qt Linguist Manual: https://doc.qt.io/qt-5/qtlinguist-index.html

    On that page the developers section seemed relevant: https://doc.qt.io/qt-5/linguist-programmers.html

    Which referenced a simple example: https://doc.qt.io/qt-5/qtlinguist-hellotr-example.html

    So that's the reason how I ended up with this :) I can't recall that those pages mention the resource system. Thanks for the link by the way! I'll read that page to see if it's a better choice. But I guess the file embedding lesson learned here will come handy in that case as well.

  • 0 Votes
    1 Posts
    196 Views
    No one has replied
  • How to disable dialog.exec() warning?

    Unsolved
    3
    0 Votes
    3 Posts
    391 Views
    W
    @lorn-potter Yes, I rebuild QT with the below configure., and thread and asyncify work well.

    configure -no-warnings-are-errors -qt-host-path e:/qt/6.3.0/mingw_64 -xplatform wasm-emscripten -nomake examples -feature-thread -device-option QT_EMSCRIPTEN_ASYNCIFY=1 -prefix e:/Qt/6.3.0/wasm_async

  • Touchscreen in WebAssembly application

    Solved
    6
    0 Votes
    6 Posts
    765 Views
    RenioR

    @lorn-potter My Boss, want to use a laptop with a touchscreen display and this device have windows installed.

  • Qt for Web Assembly and the Open Source version

    Unsolved
    2
    0 Votes
    2 Posts
    427 Views
    JKSHJ

    Hi, and welcome!

    @iSchraeder said in Qt for Web Assembly and the Open Source version:

    Because I'm being contracted to write this software for the in-house use of a single organization, I'm not sure how that fits into the "personal use" conditions of the licenses.

    Since you are writing this for someone else, it does not count as "personal use". It is personal use only if you yourself are the end-user of the software.

    With the other platforms, it seems I can just avoid using certain components and keep dynamic linking enabled as to not violate the LGPL v3 license, but with web assembly, this seems like more of a predicament, as you cannot allow the user to freely change the .dll of the LGPL v3 licensed components.

    That's correct. You either purchase a commercial license, or you use Qt WebAssembly under the GPLv3 license.

    If you go with the GPLv3 license, then you must provide your client with a full copy of your source code, the license text, as well as a written offer to provide them with the source code of Qt. However, since your client is intending it for internal use, they don't need to provide the code or the application to anyone else.

    (Under the GPLv3, the code only needs to be offered to whoever receives the software)

    If anyone could help me navigate this, I'm putting as much concern into this as I am the actual project despite probably having no risk of being sued.

    We're happy to help where we can. Just note that what I wrote above is based on my personal understanding, is not comprehensive, and does not constitute legal advice.

  • Build QT 6.3 using system libraries (zlib, sqlite, etc.)

    Unsolved
    3
    0 Votes
    3 Posts
    945 Views
    J

    Regarding your first point, I am trying to use Emscripten "Faux Dynamic Linking" which allows you to merge all your .so files in the last step of compiling with emcc. From what I understood of Emscripten documentation, this is the way to use multiple times the same library in a project without having to deal with duplicated symbols:

    By default, when the -shared flag is used to build a shared library, Emscripten will produce an .so library that is actually just a regular .o object file (Under the hood it uses ld -r to combine objects into a single larger object). When these faux “shared libraries” are linked into your application they are effectively linked as static libraries. When building these shared libraries Emcc will ignore other shared libraries on the command line. This is to ensure that the same dynamic library is not linked multiple times in intermediate build stages, which would result in duplicate symbol errors.

    For SQL, I know that it is not supported however I am able to build QT with internal sqlite3 library so it should work as well with an external lib. This is probably broken but I don't really care at this stage as I am just trying to include it to avoid having to refactor the code of the main project.

  • qt 6.3 & asyncify

    Unsolved
    6
    0 Votes
    6 Posts
    954 Views
    W

    @sitesv em, that's depends. To me, wasm is wonderful, because my clients always require B/S solution. with wasm I can support one code for both C/S and B/S, and I don't need java guys :)

  • Qt 6.3.0 Player Application

    Unsolved
    1
    0 Votes
    1 Posts
    349 Views
    No one has replied
  • Build QT6.3 wasm from source, configure error.

    Solved
    5
    0 Votes
    5 Posts
    961 Views
    W

    @sitesv I try many config parametors combination, but get the same error. And I even try linux version, it also get the same error. Maybe because I am using the open source version. it's a bug, I think.

    Finaly, I found that qmlls is no use for me. So I check the file in src\qtdeclarative\tools\CMakeList.txt, and comment out the line aboue qmlls. and the I configure ok, and make sucess.

  • 0 Votes
    3 Posts
    340 Views
    L

    I had the same problem and I solved it like this:

    QQmlApplicationEngine engine; // do loading here... auto rootObject = engine.rootObjects().first(); static_cast< QQuickWindow* >( rootObject )->raise();

    The root object is a QML Window.