Skip to content

Qt for WebAssembly

Specific issues when using Qt for WebAssembly

456 Topics 1.8k Posts
  • Links for Qt for WebAssembly

    Pinned Unsolved
    6
    7 Votes
    6 Posts
    4k Views
    S
    @tansgumus said in Links for Qt for WebAssembly: Fireofox 76.0 (64-bit) Fireofox 76.0 (64-bit) nooooooooooooooooooo this very bad
  • wasm-ld: error: duplicate symbol from libqt6core

    Unsolved
    3
    0 Votes
    3 Posts
    101 Views
    KyefK
    Thank you @jsulm for the response. Here is my CMakeLists.txt below: CMakeLists.txt cmake_minimum_required(VERSION 3.16) project(demoApp VERSION 0.1 LANGUAGES CXX) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_AUTOMOC ON) set(QT_QML_GENERATE_QMLLS_INI ON) find_package(Qt6 6.4 REQUIRED COMPONENTS Quick Network Sql WebSockets ) # find_package(MySQL REQUIRED) qt_standard_project_setup(REQUIRES 6.4) qt_policy(SET QTP0001 NEW) qt_add_executable(appdemoApp main.cpp ) qt_add_qml_module(appdemoApp URI demoApp VERSION 1.0 RESOURCE_PREFIX / SOURCES mainworker.h mainworker.cpp applogger.h applogger.cpp icons/Resource.qrc QML_FILES Main.qml Login.qml Userreg.qml ) # Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1. # If you are developing for iOS or macOS you should consider setting an # explicit, fixed bundle identifier manually though. set_target_properties(appdemoApp PROPERTIES # MACOSX_BUNDLE_GUI_IDENTIFIER com.example.appdemoApp MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} MACOSX_BUNDLE TRUE WIN32_EXECUTABLE TRUE ) target_link_libraries(appdemoApp PRIVATE Qt6::Quick PRIVATE Qt6::Network PRIVATE Qt6::Sql PRIVATE Qt6::WebSockets ) include(GNUInstallDirs) install(TARGETS appdemoApp BUNDLE DESTINATION . LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) I was thinking I could be linking to a wrong library and mysql include directory however, Cmake runs the configurations very well and indicated MYSQL:MYSQL is found.
  • Qt Widgets Application

    Solved
    5
    0 Votes
    5 Posts
    192 Views
    SGaistS
    @davidweisgerber hi, Since you dived in already, I would encourage you to submit a patch to improve the documentation on that aspect.
  • Importing a C++ types declared using the QML_ELEMENT return module is not installed

    Unsolved
    2
    0 Votes
    2 Posts
    577 Views
    S
    I think I might have a similar problem. Any update on your original issue?
  • My Qt Quick Web Assembly app won't to pass over the loading screen

    Unsolved
    5
    0 Votes
    5 Posts
    804 Views
    MesrineM
    If I remember well, this SharedArrayBuffer is needed when using wasm multithreading. If your app does not need multithreading, use Qt wasm single threading. If multithreading is needed, check https://forum.qt.io/post/765010
  • Loading external web images...

    Unsolved
    3
    0 Votes
    3 Posts
    536 Views
    1
    @mv-whw Thanks for answering Yes, that is the solution, putting inside my hosting public www folder all my resources: index.html main.wasm images/image0.png images/image1.png inside the wasm code: Image { source: "images/image0.png" } That worked well... and is very nice, this saves a lot of loading times..
  • webassembly does not display picture urls from web

    Solved
    7
    0 Votes
    7 Posts
    2k Views
    1
    @Jan-Bakker Hey, sorry for answering an answered qustion. Justo happy to read it, so, it is possible to load external images in Your web app so your wasm file is smaller?
  • RangeMemory: could not allocate memory on startup

    Unsolved
    2
    0 Votes
    2 Posts
    382 Views
    JonBJ
    @Caro You might start by Googling webassembly memory () could not allocate memory and read through the other reports and comments.
  • Simple WASM demo source

    Unsolved
    1
    0 Votes
    1 Posts
    316 Views
    No one has replied
  • Qt 6.8.2 for wasm on android, the keyboard always auto popup ?

    Solved
    4
    0 Votes
    4 Posts
    661 Views
    L
    @SGaist said in Qt 6.8.2 for wasm on android, the keyboard always auto popup ?: Can you share the bug report ? https://bugreports.qt.io/browse/QTBUG-134917 https://bugreports.qt.io/browse/QTBUG-133781
  • Qt WebAssembly using QDialog bug

    Unsolved
    1
    1 Votes
    1 Posts
    224 Views
    No one has replied
  • How to decode QR Code on wasm ?

    Solved
    4
    0 Votes
    4 Posts
    797 Views
    D
    I can't figure out how to build a lib for qzxing so I can link it with my application. I've tried cmake and qmake and nothing out of the box works. How did you compile qzxing? I am using qt 6.8.2 on windows 11.
  • Get Request Webassemply

    Solved
    2
    0 Votes
    2 Posts
    445 Views
    piervalliP
    There are two fantistic api in c++ #ifdef __EMSCRIPTEN__ #include <emscripten.h> // Required for calling JavaScript #endif #ifdef __EMSCRIPTEN__ // WebAssembly-specific code emscripten_run_script("console.log('Running in WebAssembly');"); #endif #ifdef __EMSCRIPTEN__ const char* url = emscripten_run_script_string("window.location.href"); qDebug() << "Current Page URL:" << url; #endif
  • QIcon ThemeIcons not showing up in WebAssembly apps

    Unsolved qicon themeicon
    3
    0 Votes
    3 Posts
    570 Views
    GilboonetG
    For WebAssembly you cannot use theme icons directly but must use the Qt Ressource System
  • onscreen Keyboard popup up with or without focus

    Unsolved webassembly screenkeyboard c++ wasm inputdevice
    3
    1 Votes
    3 Posts
    2k Views
    E
    This might be QTBUG-133781, which release are you using ?
  • Problem with loading WASM application on IGEL terminal

    Unsolved
    1
    0 Votes
    1 Posts
    267 Views
    No one has replied
  • Receiving QNetworkReply::ProtocolFailure to GET request

    Solved
    2
    0 Votes
    2 Posts
    492 Views
    L
    The solution to the problem is to add the header res.addHeader("Access-Control-Allow-Origin", "*"); to the HTTP server; hServer.route("/", QHttpServerRequest::Method::Get, []() { QString testAnswer = "TEST REPLY"; res.addHeader("Access-Control-Allow-Origin", "*"); // Added line QHttpServerResponse res(testAnswer, QHttpServerResponse::StatusCode::Ok); return res; }); After adding this line, the browser forwarded the reply to my application.
  • How to Properly Exit a Qt WebAssembly Application?

    Unsolved
    1
    0 Votes
    1 Posts
    279 Views
    No one has replied
  • HttpsStatusCodeAttribute not working properly.

    Solved
    4
    0 Votes
    4 Posts
    814 Views
    L
    After some investigation, I don't believe the issue is related to the attribute method. The entire received reply is empty. There are no headers or body received by the application. The Wireshark capture shows that the entire message is properly sent out by my HTTP server and received by the browser, however, the application does not receive it. I checked if any error was reported by the reply and received an error QNetworkReply::ProtocolFailure (399). I believe the browser strips that information and does not propagate it further to the application. I tested this in Firefox and Chrome with the same results. As I mentioned in my original post, the communication works perfectly when compiled as a desktop application. The issue was only observed when compiled by WebAssembly. I will close this post and reopen a new one with a new question.
  • System cannot find specified file when building Web Assembly project in Qt

    Unsolved
    11
    0 Votes
    11 Posts
    2k Views
    GilboonetG
    @lorn-potter Thank you, I think the OP needs help from someone who already built a Wasm project with Multimedia as he didn't manage to have his project built, on the pinned discussion almost all links are dead or out of date which doesn't help much.