[Development] Qt for WebAssembly

Lorn Potter lorn.potter at gmail.com
Fri Mar 9 20:16:55 CET 2018


Hi, I would like to add...
One of the guys over at https://qtmob.slack.com keeps a demonstration of 
the Qt examples for Qt Webassembly (thanks David!):

https://s3.eu-west-2.amazonaws.com/wasm-qt-examples/last/index.html

Not all of the examples work, and not all of them work correctly.
Firefox seems to be fastest.

On 9/3/18 10:57 pm, Morten Sørvig wrote:
> Hi all,

> * Networking
> 
>    We are looking there approaches: (not mutually exclusive)
> 
>    - A QNetworkAccessManager backend implemented using XMLHttpRequest/Fetch.
> 
>      This allows making HTTP REST requests back to the origin server, or to other servers
>      by using CORS.
>    
>    - A QWebSocket (client) backend implemented using HTML5 WebSocket
> 
>      This would allow making websocket connections to any server.
> 
>    - Using the emscripten sockets implementation and websockify.
> 
>      This is a tunneling solution where the server runs e.g. websockify and will forward
>      to a pre-determined target. Supports (unix) TCP and UDP sockets, so no work
>      is needed in Qt.

While emscripten translates native sockets into websockets, the issue 
with just using sockets for networking like Qt internally does, is that 
there are no real DNS lookups due to the sandbox in which webassembly 
runs. Which is why we needed to use alternate methods.

There are also emscripten's wget functions. At least to download, 
emscripten has various _wget* functions which are available.


Probably the biggest gotcha, is that exec currently does not return in 
the way you would expect. So for example, the scribble example does not 
change the pen color.





More information about the Development mailing list