Monday, June 5, 2017

Qt for web (assembly)

So ya, I have been doing work for the up and coming Finnish company Intopalo getting Qt5 for WebAssembly using emscripten up and running. This is the 3rd Finnish company I have done work for, and the 4th Nordic company (Trolltech, Nokia, Jolla, Intopalo)

This is very much a work in progress.

Background:

There was a Qt4 version, emscripten-qt and a related Qt5 for Native Client which do similar things, and we have taken inspiration from both these projects. Thanks!

The gist of it:

We use emscripten to cross compile Qt5 into javascript and/or webassembly. We use 'incoming' from emscripten's git repo. Details how to build emsdk are here.

My working Qt5 repo is here, (the wm branch contains multi window and window decorations) while there is also an outdated WIP gerrit MR  which will get updated at some point.

This is how I configure Qt for emscripten:
 . ~/emsdk/emsdk_env.sh (to get em compiler in path)

~/depot/qt/qt5/qtbase/configure -xplatform emscripten -confirm-license -opensource -nomake tests  -nomake examples -developer-build -no-dbus -no-thread

 (no-thread is a new feature I added for this, as threading in javascript is basically non existent)

and then, use that qmake to compile a Qt app!

To run the app, in the firefox browser
emrun --browser firefox path/to/app.html

This is all bleeding edge from the emscripten compiler to the web assembly support in the browser, so your mileage may vary.

With the 'wm' branch of my github repo, multi windows and window decorations are kind of working. As well as compiling into webassembly and not just javascript asmjs.
Compiling into wasm brings much smaller download sizes, but you need to have a browser that supports it.

There is still heaps of work to do to bring it up to release state. So for now, it is still a research and WIP project, and a lot of things may or may not work. But it can run some Qt widget based apps in your (firefox) browser!

The future:

Currently there is no support for qml/qt quick. That just means we haven't tried it as our focus is currently on widgets and opengl.

Personally, I would like to see location and some sensor events, but that is for the future.

17 comments:

Unknown said...

Hi deviceguy!

Thank you for your information!
I've already built emsdk and cloned your qt5-emscripten.
What else should be installed before ruuning app (may be qt-base or qtdeclarative)

Regards,
Artem

billconan said...

This is awesome! but I hope you could put up a demo page to let people feel the performance.

SSJ said...

Great stuff - glad to see this is being continued for Qt 5 :)

Heke said...

Minkälaisia virtuaalikoneita tuon wasmin päällä voi pyörittää?

Heke said...
This comment has been removed by the author.
Yes done - Best Professional On Demand Home Service Provider in Jaipur said...

Thanks for sharing this information.
Yes Done is the best online site for on demand home services, professional service providers in Jaipur, Rajasthan. We are providing top services like carpenter, cleaning, TV, and many more services at your doorstep in Jaipur, Rajasthan. For more services visit our website.

Pheeta.in said...

Thanks for sharing this information.
Pheeta is the best online shopping sites for Salwar suits for women and woman Kurti online in Jaipur, Rajasthan. To shop more latest fancy and attractive dresses and Kurtas visit us at our website.

Mediwapp - Best Online Medicine Store in India and a leading Online Medicine Store in India said...

Thank you for sharing this information.


Mediwapp is the best Online Medical Store and a leading Online Medicine store which sells different and most trusted products like Medicines, OTC-Products and other Medicine and Surgery Devices across India.

Jewellery By Mitali Jain - Minimal & Contemporary Jewellery said...

Thank you for sharing our information.

Jewellery By Mitali Jain is the best website to buy artificial jewellery online and Jain Jewellery in Jaipur. They sell fancy and attractive products like Earrings, Rings, Necklaces, Headgears, Bracelets, Mask and Glass Chains, Bookmark Jewellery, Gift Cards and many more items like this. And also checkout our new collections Summer Luna Collection and Holy Mess Collection.

Hindustan Tradecom Pvt. Ltd. said...

This is really amazing blog and like to share Hindustan Tradecom.

Hindustan Tradecom is the best website where you can open your Demat Account in Jaipur, jodhpur, Bikaner, Kota, Rajasthan. We provide best services opening a Free Deamt Account. We also help you opening Demat Account in Different Banks. For other services like Equity Trading, Commodity trading, Currency Derivatives, Easy-IPOs, Mutual Funds, and many more. Please visit our website.

Apparrant Technologies - Best Web and Custom Mobile Application Development Agency in Noida said...

Thanks for sharing this information.
Apparrant is the best Mobile App Development Company in Noida and Web Application Development Company in Noida, Delhi NCR, Gurgaon, Faridabad, India, Toronto, and Canada. We are a leading Software Quality Assurance and App Testing company in Noida, India. We also provide IoT App Development Services in Noida as well as the best Project Management Services in Noida, Delhi NCR.

GIEC Global - Best Migration Agent Melbourne & Education Consultant in Melbourne, Australia said...

Nice Blog information.
GIEC Global is the best canada migration agent in Melbourne, Australia and education consultant in Melbourne, Sydney, Brisbane, Perth, Adelaide,Australia. If you want to migrate to Australia, or visit to Australia or work in Australia then GIEC Global is the right place for you to consult.

SilverMountain - Best Gold and Silver Jewellery Designers in Jaipur said...

Thanks for sharing this information

Shop jewellery from Best Silver Jewellery Designer and Manufacturer in Jaipur , Buy jaipuri bangles online, rajasthani silver jewellery, Latest maang tikka designs, 925 silver earring, Best designer silver pendant necklace, silver kundan jewellery, marhaba jewellery925 silver jewellery wholesale jewellery manufacturers in jaipur is SilverMountain Jaipur.

Lautrop and Uhre Aps Fine Jewellery said...

Tak for deling af disse oplysninger. Lautrop & Uhre er et bedste websted til shopping guldsmykker og forgyldte sølv smykker som guldringe, guldarmbånd, guld halskæder, guld øreringe, forgyldte sølv halskæder, forgyldte sølv armbånd, forgyldte sølv ringe og forgyldte sølv øreringe.

Meerahini Jaipur - Buy Salwar Suits, Kurta Sets, Plazzo Sets, Loungewear and premium woman clothing's said...

Wow, what a nice blog. I have read it and really impressed by its writing.
Meerahini is the best site to buy Jaipur Salwar Suits Online and Hand block Kurta sets. We have straight suit sets, anarkali suit sets, kurta and plazzo sets, and Sharara Sets. We have premium clothing collection of Rang and Utsav.

GIEC Global - Best Migration Agent Melbourne & Education Consultant in Melbourne, Australia said...

Nice Blog information.
GIEC Global is the Best Education Consultants in Melbourne, Australia and education consultant in Melbourne, Sydney, Brisbane, Perth, Adelaide,Australia. If you want to migrate to Australia, or visit to Australia or work in Australia then GIEC Global is the right place for you to consult.

GIEC Global - Best Migration Agent Melbourne & Education Consultant in Melbourne, Australia said...

GIEC GLOBAL is the best education consultant in melbourne. We are formost education consultants in melbourne. We are prime education migration agent in melbourne and best performance education in melbourne. For the study and work in melbourne. Our services are in melbourne as migration and education consultants. we are education agents in Australia and provide education migration services in Australia.