How to port Qt qml to a web server using C ++ - backend

Is it possible to write the front-end of my application in QML and the back-end in C ++ and somehow compile it so that I can deploy it to a web server such as Apache or JBoss so that it is accessible from inside the website browser ?

If so, do you have examples of how to do this?

Thanks so much for your answers :)

I tried to find the answer to my question on the Internet, but I failed.

+6
source share
3 answers

QmlWeb is a JavaScript library that can parse QML code and create a website from it using regular HTML / DOM elements and absolute CSS positions, translating QML properties into CSS properties.

QmlWeb is a small project, started primarily by Lauri Pimen, who has been developing it for several years and is currently a KDE project supported by Anton Kreuzkamp.

QmlWeb, of course, does not yet support all Qts implementations of QML, but it already supports a completely usable subset. It supports almost all of the basic QML syntax. In addition, it supports HTML input elements (Button, TextInput, TextArea is currently supported, not all).

Well, QmlWeb is not finished. I hope Digia helps in this project to prepare it with mature features.

+4
source

Currently, javascript is on top of v8, but serves to express complex bindings and some (preferably small) client logic. But the engine may change ( http://blog.qt.digia.com/blog/2013/04/15/evolution-of-the-qml-engine-part-1/ ).

As with the browser, the actual graphics are orthogonal to javascript, which can interact (or create instances) with existing graphics. In the graphics browser, html / css / svg / dom is described and interpreted by a web engine written in C ++. In QtQuick, charts are written in Qml and interpreted by the qml (scengraph) engine written in C ++.

The two stacks are completely different.

Exception from Html canvas and Qml canvas (which almost shares the same api). But this is graphics that works in immediate mode (unlike the SVG or Qml script, which works in save mode).


It is said ...

There are 3 attempts to transfer Qml to the Internet:

  • Qt port for Google Nacl (never heard of this for a long time, most likely dead).
  • Qt port via Emscripten / asm.js (amazing project, but not viable for production, and I donโ€™t think QtQuick is even supported ... it can take a lot of work to be actively supported).
  • QmlWeb (Javascript apis for translating Qml files and interpreting them over the HTML5 stack). Work in progress and only a subset of the entire QtQuick ecosystem can be supported in the long run. But still a really interesting project, and perhaps the most promising of all three. At least it is the youngest, and it can get some benefit from the KDE community. http://akreuzkamp.de/2013/07/10/webapps-written-in-qml-not-far-from-reality-anymore/

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

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

+3
source

No. You cannot compile QML, and in any form, it cannot be deployed to a Java application server such as JBoss. Qml is strictly intended to create applications for working on the local machine. It looks like you want to create a web application from HTML with some kind of backend, such as .Net.

0
source

Source: https://habr.com/ru/post/950527/


All Articles