|Qt For WebAssembly|
|Written by Ian Elliot|
|Wednesday, 25 April 2018|
Qt is a popular way to construct a cross platform UI, but the latest move is into the unknown and could change the way we create web apps. Qt for WebAssembly is now in beta.
The main problem with Qt is that many potential users are confused about the licencing issues. The Qt company offers an open source version and a commercial licenced version. Obviously it wants you to pay up and keep the company going, but many programmers don't understand the terms of the open source licence. The most common interpretation is that you have to open source your own proprietary code and this is a big negative. Worse, some even think that this means you can't sell an open source Qt project. The truth is fairly well hidden in the documentation. The main gist is that you can keep your code proprietary and sell it as long as the user is free to substitute a new Qt library, i.e. you have to use dynamic linking and you can't modify the Qt library. If you do modify the Qt library then you have to make the changes open source.
"It is recommended to either link dynamically, or provide the application source code to the user under LGPL."
There are various other restrictions, but none that should impact the average project, commercial or open source. If you are working with a big company with lots of patents to enforce, then you are better with the commercial edition because of the patent clause in the LGPL.
OK, with this all explained what has Qt got to do with WebAssembly?
How does this work?
The answer is that it uses a canvas element to draw the UI and hence there is minimal interaction with the DOM. You can work within your Qt program without worrying about HTML and can let the framework render the UI elements.
Currently there is a beta that you can try out and there should be a tech preview included with Qt 5.11. At the moment you can only try it out on Linux or macOS, i.e. not Windows. You also have to install and use Emscripten, the C/C++ compiler to WebAssembly, and this isn't trivial. Some users are reporting successfully running large Qt apps in the browser. There are a few demos, but nothing that would excite an innocent user.
Of course there are the doubters who think that the whole WebAssembly issue is just another complication in an already over-complex environment and adding Qt to the mix is even worse.
Perhaps in the future we will be using any language we care to with Qt for the UI and have apps running in the browser or native, but not quite yet.
or email your comment to: firstname.lastname@example.org
|Last Updated ( Wednesday, 25 April 2018 )|