实际上Qt中使用JS是失败的,Qt公司的人也承认了,预计Qt6中又会有大的改动:https://www.qt.io/blog/2019/08/07/technical-vision-qt-6
Next-generation QML
...
Make JavaScript an optional feature of QML. Having a full JavaScript engine when using QML can complicate things and is an overhead especially when targeting low-end hardware such as microcontrollers. It is however extremely useful in many use cases.