JavaScript

    TIP

    There is an open question in the Qt community about the right mixture about QML/JS/Qt C++ in a modern Qt application. The commonly agreed recommended mixture is to limit the JS part of your application to a minimum and do your business logic inside Qt C++ and the UI logic inside QML/JS.

    Here a short example of how JS used in QML looks like:

    So JavaScript can come in many places inside QML as a standalone JS function, as a JS module and it can be on every right side of a property binding.

    1. Button {
    2. width: 200
    3. height: width*2 // JS on the right side of property binding
    4. // standalone function (not really useful)
    5. function log(msg) {
    6. console.log("Button> " + msg);
    7. }
    8. // this is JavaScript
    9. log();
    10. Qt.quit();
    11. }

    TIP

    In general: backend developers are functional driven and frontend developers are user story driven.