Remix.run Logo
rubymamis 8 hours ago

QML isn't slower than Qt QWidgets, in the end of the day Qt Quick components are simply C++ objects, you can look at the source code[1].

[1] https://github.com/qt/qtdeclarative

noodletheworld 7 hours ago | parent [-]

Hum…

QtQuick uses a different runtime which is (afaik) faster and targets modern graphics backends (eg. Vulcan) in a way widgets does not.

It also uses an a javascript scripting engine.

Saying “they’re both c++” is seems kind of misleading and meaningless right?

It’s probably more accurate to say QML is actively being worked on and receiving performance enhancements and updates and widgets is not, and has not for some time.

So yes, it’s actually pretty unlikely that QML would be slower (depending on what you do with your scripts) but it’s probably not as clear cut as you are suggesting.

QML apps that heavily implement core logic in javascript would be slow as balls.

rubymamis 6 hours ago | parent [-]

> Saying “they’re both c++” is seems kind of misleading and meaningless right?

Not really, if you avoid writing Javascript code in your QML components, than most of your executable will end up being compiled C++ code. If you do write Javascript code in your QML components, than it *could also* be compiled to C++ code using the QML script compiler[1[2].

> QML apps that heavily implement core logic in javascript would be slow as balls.

The entire point is to separate logic and view where logic is written in C++ and QML simply represents the view (which almost end up being built upon simple primitives that *are* C++ objects). So if you keep this separation you get amazing performance with great simplicity and velocity.

[1] https://doc.qt.io/qt-6/qtqml-qtquick-compiler-tech.html

[2] https://doc.qt.io/qt-6/qtqml-qml-script-compiler.html