Dear anda_skoa , let me do that again - a little bit more obvious - in the hopes you understand it this time.
I retract my condolences. Obviously you like the language. I'm not trying to deprive you of the fun or demean the language in any way. I just have the impression you are a bit blue-eyed on its consequences.
A QML program looks strikingly similar to a mixture between JavaScript and CSS. Wikipedia writes: "It is a declarative language (similar to CSS and JSON)"
The QML language runs in an "engine" which is started at the beginning of the application and is stopped when the application is stopped. That is an obvious reminder (more like a hint with a fencing post) that there is a QML engine running in the background. (looking from the QML code point of view, it would be the foreground).
The "tree of QObject instances" is the corresponding equivalent of the DOM object in an e.g. HTML web application.
An obvious general statement that is true for most programming languages "If you don't use it you don't pay for it". But for a web stack, there is `WebSocket` QML type.
It's not that simple.
QML makes heavy use of QObject's property system. At run-time, connections are handled by the QML- or the JavaScript interpreter. There is a performance penalty to pay for that. In simple GUI applications that penalty is usually not that visible. But it gets more visible as the application grows more complex. A direct comparison between a bare Qt application and a QML application will reveal it.
While it is possible to improve the performance by compiling (most of) QML to C++, this is not possible by default. It needs careful configuration and there are licensing issues making that case usually impossible. But I'm only talking about the default case here.
An interesting point. Qt Quick Scene Graph makes heavy use of hardware acceleration. So it "sort of" requires it. QWidget applications do not have that limitation and do work without graphics acceleration.
But there is a way to do even that: On hardware that dearly lacks graphic acceleration, windows OS may fall back to Direct3D's software rasterizer (WARP) by default. Within Qt, it is possible to force the use of the software rasterizer by setting the environment variable QSG_RHI_PREFER_SOFTWARE_RENDERER to 1. Of course, there will be less performance.
Call it whatever you will. A QML application has essentially the same things running as any other web application.
Nothing prevents anyone to create a Qt application that simultaneously utilizes a QtWebEngine and QML and Qt WebView in the QML code. I would advise against it but as long as there is enough CPU and RAM it will run smooth - sort of.
Originally posted by anda_skoa
View Post
Originally posted by anda_skoa
View Post
A QML program looks strikingly similar to a mixture between JavaScript and CSS. Wikipedia writes: "It is a declarative language (similar to CSS and JSON)"
Code:
import QtQuick Rectangle { id: page width: 320; height: 480 color: "lightgray" Text { id: helloText text: "Hello world!" y: 30 anchors.horizontalCenter: page.horizontalCenter font.pointSize: 24; font.bold: true } }
Code:
QQmlApplicationEngine engine("main.qml");
Originally posted by anda_skoa
View Post
The "tree of QObject instances" is the corresponding equivalent of the DOM object in an e.g. HTML web application.
Originally posted by anda_skoa
View Post
An obvious general statement that is true for most programming languages "If you don't use it you don't pay for it". But for a web stack, there is `WebSocket` QML type.
Originally posted by anda_skoa
View Post
It's not that simple.
QML makes heavy use of QObject's property system. At run-time, connections are handled by the QML- or the JavaScript interpreter. There is a performance penalty to pay for that. In simple GUI applications that penalty is usually not that visible. But it gets more visible as the application grows more complex. A direct comparison between a bare Qt application and a QML application will reveal it.
While it is possible to improve the performance by compiling (most of) QML to C++, this is not possible by default. It needs careful configuration and there are licensing issues making that case usually impossible. But I'm only talking about the default case here.
Originally posted by anda_skoa
View Post
An interesting point. Qt Quick Scene Graph makes heavy use of hardware acceleration. So it "sort of" requires it. QWidget applications do not have that limitation and do work without graphics acceleration.
But there is a way to do even that: On hardware that dearly lacks graphic acceleration, windows OS may fall back to Direct3D's software rasterizer (WARP) by default. Within Qt, it is possible to force the use of the software rasterizer by setting the environment variable QSG_RHI_PREFER_SOFTWARE_RENDERER to 1. Of course, there will be less performance.
Originally posted by anda_skoa
View Post
Nothing prevents anyone to create a Qt application that simultaneously utilizes a QtWebEngine and QML and Qt WebView in the QML code. I would advise against it but as long as there is enough CPU and RAM it will run smooth - sort of.
Comment