Creating a QML app that uses a web engine... I'll end up with an app that uses two web engines.
Announcement
Collapse
No announcement yet.
KDAB Working On Embedding Servo Web Engine Within Qt
Collapse
X
-
-
Originally posted by anda_skoa View Post
How so?
Where would the second web engine come from?
Do you mean creating an app that uses both Qt's Web View and this new one?
Comment
-
Originally posted by lowflyer View PostQML is the Qt company's new "declarative language".
Originally posted by lowflyer View PostIt is based on web technologies (CSS, Javasrcipt etc.).
The QML engine creates a tree of instances of QObject based classes.
If those classes don't have any GUI dependencies then the application does not have one either. Let alone a web stack.
If those classes are QWidget derived, then it is just like any other Qt widget application, it just has created the widget tree differently.
If those classes are QQuickItem derived, then the application has a dependency on Qt hardware accelerated render infrastructure.
Originally posted by lowflyer View PostSo, you create a Qt application that uses QML - *gotcha* - you have an application that has a web engine! Even without using Qt Web View or something.
Only if the QML code refers to a type that uses a web engine, e.g. the Qt Web View.
- Likes 3
Comment
-
Originally posted by anda_skoa View PostThe QML engine creates a tree of instances of QObject based classes.
- Likes 2
Comment
-
Originally posted by lowflyer View PostQML is the Qt company's new "declarative language". KDE recently makes heavy use of it. It is based on web technologies (CSS, Javasrcipt etc.). So, you create a Qt application that uses QML - *gotcha* - you have an application that has a web engine! Even without using Qt Web View or something.
Happy 35rh birthday, WWW! Sir Timbl's ideas continue to influence the rest of software development.
Comment
-
Originally posted by anda_skoa View PostI know, I have been using it for at least a decade.
Originally posted by anda_skoa View PostNope
So, you are saying the following is not a mixture of Javascript and CSS ...
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 QML engine creates a tree of instances of QObject based classes.
A tree of object instances is exactly what every web engine does.
Originally posted by anda_skoa View Post
If those classes don't have any GUI dependencies then the application does not have one either. Let alone a web stack.
If a web engine misses a web stack it still remains a "web engine". The QQmlApplicationEngine is still running - even without a GUI.
Originally posted by anda_skoa View Post
If those classes are QWidget derived, then it is just like any other Qt widget application, it just has created the widget tree differently.
Nope.
It's a web engine that holds a widget tree. It's not the same like a "normal" QWidget based application. A performance comparision will reveal it.
Originally posted by anda_skoa View Post
If those classes are QQuickItem derived, then the application has a dependency on Qt hardware accelerated render infrastructure.
Nope.
Force Direct3D's software rasterizer (WARP) by setting the environment variable QSG_RHI_PREFER_SOFTWARE_RENDERER to 1
Originally posted by anda_skoa View Post
Nope.
Only if the QML code refers to a type that uses a web engine, e.g. the Qt Web View.
Comment
-
Originally posted by lowflyer View Post... my heartfelt condolences.
Even QtQuick is quite usable these days.
Originally posted by lowflyer View PostSo, you are saying the following is not a mixture of Javascript and CSS ...
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 } }
There is not a single line of CSS or JavaScript in there.
The build chain can even generate C++ code for pretty much everything in that file if the project setup has been configured correctly.
Originally posted by lowflyer View PostHint: if there is CSS and Javascript text somewhere in the application code, there must be a component somewhere that can read and interpret it.
Luckily none of that appears in the code above.
While JavaScript might appear in QML, you will never see any CSS.
Originally posted by lowflyer View PostA tree of object instances is exactly what every web engine does.
Not only are these different types, the QML type system is essentially fully defined by the application developer.
Any QObject derived class can be registered with the QML type system as long as it is default constructible.
in most cases the developer will make use of modules, predefined sets of types, e.g. QtQuick.
All UI frameworks work on trees of objects, very few use a web engine for that.
Originally posted by lowflyer View PostIt's a web engine that holds a widget tree. It's not the same like a "normal" QWidget based application.
For example when using DeclarativeWidgets as the QML type module.
Originally posted by lowflyer View PostA performance comparision will reveal it.
Because at runtime all painting, layouting and event handling will be done by the respective widgets and thus with the same code paths as an application with a hardcoded widget tree.
Originally posted by lowflyer View PostNope.
Force Direct3D's software rasterizer (WARP) by setting the environment variable QSG_RHI_PREFER_SOFTWARE_RENDERER to 1
Who would have thought!?
Obviously I was referring to the default configuration.
Originally posted by lowflyer View Post... then you'll get another web engine on top of the ones you already have.
- Likes 2
Comment
Comment