Hacker News new | ask | show | jobs
by jguegant 3539 days ago
I dream of the inverse of the react native or electron trend. In this world one would write his application using Qt Quick for all the platforms including the web! Using Emscriptem you would be able to compile your C++ code to asm.js or webassembly and make your application run flawlessly in your browser with WebGL, canvas or HTML5 as a backend. Some people already started working on that: https://blog.qt.io/blog/2015/09/25/qt-for-native-client-and-...

Even using React, Redux, flexbox layout and all these fancy frameworks, I still find the web stack a huge hack that tries to bend HTML and CSS to recreate the feeling of an app (like SPAs). QML is simply more expressive for layouts and bindings.

4 comments

Here is a demo of a QML sandbox in the browser using Qt+Emscripten if you are interested[1]. And the blog post in which I wrote about it[2]. It's quite big and not very well performing, but Qt might be useful for larger web apps one day.

[1] http://ovilab.net/projects/qt-emscripten/qml-sandbox/ [2] http://dragly.org/2016/04/27/experimental-qt-and-qml-in-the-...

Funny, I recently looked into using QML & Qt Quick as a lightweight alternative to electron, and although there are some promising factors with the approach, it became apparent that things would take a lot more work and experimentation than simply using electron.

A nimble, feature-complete starter client that is fully scriptable with javascript, i.e. qmlscene without the rough edges, would be ideal.

Is this due to unfamiliarity / learning curve with the technology or limitations found using Qt Quick? Because what you're describing sounds an awful lot like the base example when starting a new Qt Quick application project.
I hope in that universe everybody won't be downloading a copy of Chromium/Webkit/whatever with every desktop app.
The GP said "I dream of the inverse of the react native or electron trend".

That means no Chromium or other bundled web browser with every desktop app.

With Qt, you app will be light-weight, blazing fast, and have a native look and feel (as Qt uses native widgets whenever possible).

React Native doesn't bundle a web browser. It uses native widgets.
Qt already bundles QWebEngine, which is essentially a copy of Chromium
Are all Qt apps shipping and linking against QWebEngine though?
Not if you don't explicitly link against the relevant modules. That is usually done by adding a few entries in the Qt project file (qmake) and then including the headers.

http://doc.qt.io/qt-5/qtwebenginecore-module.html http://doc.qt.io/qt-5/qtwebenginewidgets-module.html

I'm looking at 32M Qt5WebKit.dll shipped with Zeal. Is this it?
agreed.