Skip to content

Qt for WebAssembly

Specific issues when using Qt for WebAssembly

410 Topics 1.6k Posts
QtWS25 Call for Papers
  • Links for Qt for WebAssembly

    Pinned Unsolved
    6
    7 Votes
    6 Posts
    3k Views
    S

    @tansgumus said in Links for Qt for WebAssembly:

    Fireofox 76.0 (64-bit)

    Fireofox 76.0 (64-bit) nooooooooooooooooooo this very bad

  • Viewport issues, (0|0) outside of the frame

    Solved
    2
    0 Votes
    2 Posts
    54 Views
    J.HilkJ

    I'm a f*ing moron, never mind.

    //old y:smallestSide - height ... //"fix" y:Math.max(smallestSide - height,0)
  • QOpenGLWidget support on Win10/iOS

    Unsolved
    11
    1 Votes
    11 Posts
    475 Views
    B

    See this as well on macOS with 6.8.0-beta.1 - repro here: https://github.com/maplibre/maplibre-native-qt/issues/49#issue-1943565551

  • 0 Votes
    6 Posts
    85 Views
    8Observer88

    The Emscripten issue: emscripten_set_mousedown_callback does not call the callback function from Qt Creator

  • 0 Votes
    5 Posts
    69 Views
    8Observer88

    The bug report was closed because You need to handle this in a javascript mouse event and not a Qt mouse event. I will continue here: https://forum.qt.io/topic/157373/emscripten_set_mousedown_callback-does-not-call-the-callback-function

  • 0 Votes
    6 Posts
    92 Views
    8Observer88

    Lorn Potter added a comment in the bug report

    The mouse cursor is owned by the browser, and apparently setting mouse position in the browser is not allowed due to security issues.

    I will continue to find another way to lock a mouse cursor in the following topic: emscripten_request_pointerlock() returns EMSCRIPTEN_RESULT_UNKNOWN_TARGET

  • 1 Votes
    3 Posts
    1k Views
    8Observer88

    pro:

    wasm: INCLUDEPATH += "C:\emsdk\upstream\emscripten\cache\sysroot\include"

    Settings for Qt 6.6.3:

    image.png

  • Unable to open WebSocket with a request parameter

    Unsolved
    4
    0 Votes
    4 Posts
    190 Views
    8Observer88

    I had a problem with connection with the server on the free Glitch hosting from WASM. I solved it by setting User-Agent. I use Qt 6.6.3. Maybe it will help:

    QUrl url("wss://merciful-regal-soursop.glitch.me"); QNetworkRequest request; request.setUrl(url); request.setRawHeader(QByteArray("User-Agent"), QByteArray("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 " "(KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36")); m_webSocket.open(request);

    And I had another problem with connection from Android. I was solved it like this: Get data with Qt client from deployed Node.js server using WebSockets

  • Detecting a mobile browser with Qt WebAssembly

    Solved
    4
    0 Votes
    4 Posts
    108 Views
    8Observer88

    I have replaced the follwing line in the code example above:

    #ifdef Q_OS_ANDROID

    with this one to detect iOS too:

    #if defined Q_OS_ANDROID || defined Q_OS_IOS
  • emscripten.h: No such file or directory

    Solved
    3
    0 Votes
    3 Posts
    88 Views
    8Observer88

    Solution is to add the following INCLUDEPATH:

    QT += core gui widgets INCLUDEPATH += "C:\emsdk\upstream\emscripten\cache\sysroot\include" CONFIG += c++17 SOURCES += \ main.cpp

    To avoid conflicting declaration do not compile for Desktop. Compile for WebAssembly.

  • Using IndexedDB in QWebAssembly

    Unsolved
    1
    0 Votes
    1 Posts
    48 Views
    No one has replied
  • 0 Votes
    5 Posts
    172 Views
    O

    This worked for me:

    QMAKE_LFLAGS += -Wl,-error-limit=0
  • run Qt WASM across private network

    Unsolved
    3
    0 Votes
    3 Posts
    162 Views
    B

    Hello @jhayar,

    It seems like you're facing issues with accessing a Qt application running as WebAssembly (WASM) from other devices within the same private network.

    Ensure your Qt application is configured to listen on localhost (127.0.0.1) and try accessing it from another device using the host machine's IP address instead of localhost. Double-check your network configuration to ensure that devices within the same subnet can communicate. If your Qt application is served through a web server like Nginx or Apache, ensure that CORS headers are correctly set to allow access from other IP addresses within your private network. Although HTTPS is recommended for security, if it's not feasible for your private setup, consider alternatives like configuring your network or application to allow HTTP connections securely within your private environment.

  • 0 Votes
    4 Posts
    532 Views
    S

    @semlanik said in configuring QT with webassembly issue: failed on Qt6ProtobufTools, WrapProtoc not found:

    -skip qtgrpc also can help in this case, if you don't need it in your Qt build.

    Yep - or uninstall Qt Protobuf component using the maintaince tool.

  • how to enable JSPI to use QSettings::WebIndexedDBFormat

    Unsolved
    4
    0 Votes
    4 Posts
    115 Views
    L

    @jsulm Thank you for your answer. I forgot to mention it. In fact, my chrome has enabled JSPI, but the error is as mentioned above...

  • 3D With Web Assembly

    Unsolved
    4
    0 Votes
    4 Posts
    443 Views
    lorn.potterL

    Probably not, as Qt3D makes liberal use of threads, and webassmbly (WebGL) only works in the main thread (WebWorker)

  • WebAssembly create and download pdf and xlsx files

    Unsolved
    2
    0 Votes
    2 Posts
    127 Views
    W

    I was able to download the file in the following way, the backend that I have made in nestjs
    generates the pdf file, I consume it from the front with qnetworkaccesmanager
    and finally QFileDialog::saveFileContent(reply->readAll(), "peport.pdf" )Captura de pantalla 2024-04-30 a la(s) 9.01.17 p. m..png

  • 1 Votes
    3 Posts
    138 Views
    S

    With normal caveats regarding "threads" (web workers in web parlance) you could just run your data simulation in a thread and then use the main thread to update your VBO and render.

  • Qt Creator runs WebAssembly in Internet Explorer

    Solved
    3
    0 Votes
    3 Posts
    177 Views
    8Observer88

    It works now on Chrome. I just have restarted Qt Creator.

  • How to include 3rd party library

    Unsolved
    6
    0 Votes
    6 Posts
    261 Views
    8Observer88

    @Saju I didn't use OpenCV. But try these steps that I use for another libraries:

    Add C:\emsdk\upstream\emscripten to the Path variable cd opencv-1.2.3 && mkdir build && cd build emcmake cmake .. emmake make INCLUDEPATH += "E:/libs/opencv-1.2.3/include" LIBS += -L"E:/libs/opencv-1.2.3/build/lib" LIBS += -lopencv