[Development] Are there plans to decouple QML from JavaScript?

d3fault d3faultdotxbe at gmail.com
Sun May 27 20:43:31 CEST 2018

Now that QML can be precompiled and has a software renderer, I see it
as *almost* usable. One final piece missing to get me on board:
decouple qml from js.

to re-state old arguments:
-I already have all of C/C++ at my disposal, JS buys me nothing
-If I don't use it, I shouldn't have to pay for it

>From a C++ perspective, Bindings are really the only interesting
feature that JS brings, but those don't require JS! JS was just a
lazy/quick/hacky/EXPENSIVE way to get Bindings in QML. A much better
approach would be to parse the Bindings using libclang [0] and
generate regular Qt/C++ code to support the bindings [1]. That being
said, I don't even need bindings and am perfectly content using
signals/slots to update the GUI.

What if there was a per-project config, say "QML_NoJS", that when
enabled, causes compilation to error out if there is any JS detected?
Qt Lite project would additionally need to support compiling QML
without JS, but that's obvious.


[0] - https://llvm.org/docs/tutorial/OCamlLangImpl1.html
[1] - https://forum.qt.io/topic/16009/does-qt-need-a-modern-c-gui-api/132?page=4

More information about the Development mailing list