[Development] Qt for WebAssembly

Svenn-Arne Dragly svenn-arne.dragly at qt.io
Tue Mar 13 15:27:33 CET 2018


On 03/09/2018 03:53 PM, Jason H wrote:
> While I am excited about this, I still wonder that it's the right approach. By right, I mean scalable.
> After evaluating the WebGL platform (which I was excited about as well) had having extreme performance issues, I foresee that this will has performance issues as well, because of one defect: You're rendering to a canvas what the browser can draw natively. If people want to serve Qt apps to the web, then the best approach (IMHO) is to use a server to send a client which is defined in HTML5 (name clash with Q_OS_HTML5) as non-canvas DOM elements (unless you're using a QPainter). This will leverage the browser in the best way possible, and let it handle the low-level drawing. To this end QMLWeb is an existing approach (https://github.com/qmlweb/qmlweb).
I think this depends on the use case. QMLWeb is doing a great job of 
bringing the QML language to web applications, which I personally find 
much more appealing than working with HTML and CSS. And it is probably 
best to leverage the browser to draw efficiently in cases where using 
DOM elements makes sense. This is likely the case for social media 
applications, news readers, ticket services, database browsers, etc.

However, for use cases where a canvas already is the main element, 
either for 2D or 3D content, I think Qt for WebAssembly makes a lot of 
sense. The difference then is just what language and framework you use 
to produce the code that ends up drawing the canvas. And you will still 
have plenty of UI elements available with buttons, sliders, and 
checkboxes for your menus. This could be a good fit for image editing, 
painting, 3D modeling, data visualization, games, simulators, etc.

I also think Qt for WebAssembly is exciting because it opens up the 
possibility to show a minimal demo of a full application in the browser. 
Instead of showing a video of the application on a product page, a small 
demo with limited features can be presented. Sure, it might not be as 
fast and doesn't have the same features as the full application (after 
all, you want to keep the download size to a minimum for the demo), but 
it will give the user a much better idea of what your application really 
is like. And the best part is that you can create the demo from the same 
code base as you used in the full application.

Svenn-Arne




More information about the Development mailing list