How to port Qt qml to web server with C++ backend How to port Qt qml to web server with C++ backend apache apache

How to port Qt qml to web server with C++ backend


QmlWeb is a JavaScript library that is able to parse QML-code and create a website out of it using normal HTML/DOM elements and absolute positions within CSS, translating the QML properties into CSS properties.

QmlWeb is a small project started primarily by Lauri Paimen who developed it for a few years and is now a KDE project maintained by Anton Kreuzkamp.

QmlWeb of course doesn’t yet support everything Qt’s implementation of QML does, but it already supports a quite usable subset of it. It supports nearly all of the most basic QML syntax. Moreover it has support for HTML input elements (Button, TextInput, TextArea are currently supported, more to come).

Well, QmlWeb is not finished. I hope Digia help with this project to make it ready with mature features.


The javascript currently sits on top of v8 but serves the purpose of expressing complex bindings and some (preferably small) client logic. But the engine could change (http://blog.qt.digia.com/blog/2013/04/15/evolution-of-the-qml-engine-part-1/).

Like in a browser, the actual graphics are kind of orthogonal to javascript which can only interact (or instantiate) with already existing graphical objects. In a browser, the graphics are described by html/css/svg/dom, and interpreted by the web engine written in C++. In QtQuick, the graphics are written in Qml and interpreted by the qml engine (scengraph) written in C++.

The two stacks are completely different.

Exception made of the Html canvas and the Qml canvas (which almost share the same api). But those are graphics working in immediate mode (opposed to a SVG or Qml scenegraph, working in a Retained mode fashion).


That being said...

There are 3 attempts to port Qml to the web:

  • A Qt port to Google Nacl (never heard of it from a long time, most likely dead)
  • Qt port through Emscripten/asm.js (awesome project, but not viable for production, and I don't think QtQuick is even supported... might require a huge effort to be actively maintained)
  • QmlWeb (Javascript apis to translate Qml files and interpret those on top of the HTML5 stack). Work in progress and only a subset of the whole QtQuick ecosystem might be supported in the long term. But still a really interesting project and maybe the most promising of all three. At least, it is the youngest one, and it might get some traction from the KDE community. http://akreuzkamp.de/2013/07/10/webapps-written-in-qml-not-far-from-reality-anymore/

You might also be interested in other scenegraphs technologies sitting on top of the web stack (amino, cake.js, rapahel.js...).

Last but not least, you might be interested by Wt (http://www.webtoolkit.eu/wt).


No. You cannot compile QML, and in any form it cannot be deployed onto a Java Application server such as JBoss. Qml is strictly for creating applications to run on a local machine. It sounds like you want to build a Web Application out of HTML with some sort of backend like .Net.