To add some fyi... a lot of Qt experts recommend you restrict the usage of Javscript to the QML layout of GUI controls and data binding. For business logic (especially cpu-intensive tasks), use C++.
Example of that "avoid Javascript" advice:
deep link: https://youtu.be/vzs5VPTf4QQ?t=30m55s