Skip to content

Qt for WebAssembly

Specific issues when using Qt for WebAssembly

454 Topics 1.8k Posts
  • how to embed translation files?

    Solved 19 May 2022, 11:57
    0 Votes
    4 Posts
    788 Views
    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
    236 Views
    No one has replied
  • How to disable dialog.exec() warning?

    Unsolved 8 May 2022, 05:28
    0 Votes
    3 Posts
    466 Views
    @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 5 May 2022, 09:19
    0 Votes
    6 Posts
    876 Views
    @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 16 May 2022, 00:01
    0 Votes
    2 Posts
    570 Views
    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.
  • 0 Votes
    3 Posts
    1k Views
    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 27 Feb 2022, 10:59
    0 Votes
    6 Posts
    1k Views
    @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 28 Apr 2022, 17:13
    0 Votes
    1 Posts
    403 Views
    No one has replied
  • Build QT6.3 wasm from source, configure error.

    Solved 25 Apr 2022, 04:31
    0 Votes
    5 Posts
    1k Views
    @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
    413 Views
    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.
  • QProcess execute linux commands on WebAssembly

    Unsolved 18 Feb 2022, 11:55
    0 Votes
    6 Posts
    1k Views
    You can use websockify or similar proxy server to communicate with webassembly (which is client only).
  • WebAssembly Secure Websockets

    Unsolved 4 Mar 2022, 14:41
    0 Votes
    5 Posts
    1k Views
    Browsers are particular about webassembly and a secure context. Most will allow connection to 127.0.0.1. I am not sure there is any way to specify using any particular certificate though.
  • Qt/qml frontend for Node-RED

    Unsolved 14 Jun 2021, 20:02
    0 Votes
    3 Posts
    1k Views
    Hi Saurabh, Here are my answers: There's no additional benefit in using QML instead of the default Node-RED ui except that it's QML :) Although, one recent benefit is that the Node-RED ui is built with Angular 1 which is not supported any more by Google so if there's anything that need to be fixed on the Angular side, that won't be done. The project qml_uibuilder_fe is just the front-end part without integrating it into Node-RED. I'm not sure where you got stuck, but please be aware that it's compiled to webassembly so you'll need to find a Qt guide, how to target wasm. These are the ones I used (since the project is based on Qt5): https://doc.qt.io/qt-5/wasm.html https://wiki.qt.io/Qt_for_WebAssembly Once you manage to get the front-end compiled, you'll need to make it work with the Node-RED uibuilder node. Here's a complete node-red project that uses the previously mentioned front-end: https://github.com/r0ller/qml_uibuilder_be If you clone it, you should be able to start it and test the way I described it on the Node-RED forum. The integration part happens in uibuilder/uibuilder/src into which some of the generated front-end project files are copied. But only the generated qml_uibuilder.html file of the front-end project is modified and renamed to: https://github.com/r0ller/qml_uibuilder_be/blob/main/uibuilder/uibuilder/src/index.html I hope this helps :) Best regards, r0ller
  • This topic is deleted!

    Unsolved 2 Apr 2022, 20:32
    0 Votes
    1 Posts
    20 Views
    No one has replied
  • 0 Votes
    1 Posts
    287 Views
    No one has replied
  • 0 Votes
    4 Posts
    2k Views
    Maybe you need to add #include <emscripten.h> Yes, that script is for QSettings, but you could put /src in there as well.
  • QApplication::processEvents() doesn't works

    Unsolved 18 Feb 2022, 09:48
    0 Votes
    11 Posts
    1k Views
    @sitesv said in QApplication::processEvents() doesn't works: Trying to do next: C:\Qt\6.3.0>\Src\configure.bat -qt-host-path C:\Qt\6.3.0\wasm_32 -no-warnings-are-errors -platform wasm-emscripten -device-option QT_EMSCRIPTEN_ASYNCIFY=1 -prefix C:\Qt\6.3.0\wasm_32_asyncify But there is an error message: CMake Error at qtbase/cmake/QtToolHelpers,cmake:156 (message): The tool "Qt6::moc" was not found in the Qt6CoreTools package. This Q was solved. There is an error in qt host parameter... But problem with QEventLoop still exist...
  • QtWebAssembly - Push button does not work

    Solved 4 Mar 2022, 14:22
    0 Votes
    2 Posts
    368 Views
    Hello, Thank you, I found out the issue. The problem was with emscripten version. The qt6 requires 2.0.14, but i have installed latest version 3.x.x now i have installed the correct version and it works fine. Thank you. Bhimesh G K
  • How can i achieve data persistency between sessions?

    Unsolved 1 Mar 2022, 18:41
    0 Votes
    1 Posts
    233 Views
    No one has replied
  • 0 Votes
    1 Posts
    1k Views
    No one has replied