Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

application scripting with Python versus QJSEngine



  • Hi, my team has recently updated a legacy QScriptEngine application scripting system to QJSEngine. We are now considering how to redesign the system from scratch. We are using JavaScript to provide a means to interact with DJ controller hardware which we poll for new data frequently (currently it is hardcoded at 1 ms for macOS & Windows and 5 ms for Linux -- although we should change that to account for the size of the audio buffer but that's tangential). We are considering three different approaches currently:

    • JavaScript with QJSEngine
    • QML with QQmlEngine (without Qt Quick)
    • Python with Shiboken

    Although we would prefer to use Python rather than JavaScript, I am unclear how well Qt for Python works for bidirectional interaction between custom C++ classes and Python. The documentation does not say much about this. The scriptableapplication example shows it is possible, but I am still not sure if it is a good idea given our latency requirements. Can we keep the Python interpreter running persistently between polls of the DJ controller hardware to avoid the cost of reinitializing it repeatedly? Would QJSEngine provide better performance because of its tight integration with Qt?


Log in to reply