Making Your Projects Scriptable with QtScript
Speaker: Kent Hansen
QtScript offers an API that is intended to make it easy to add scripting capabilities to existing and future Qt-based projects. In application development, QtScript enables developers to script parts of their application logic and/or expose scripting APIs to end users; in library development, QtScript can be used to construct powerful script-based plugin architectures. In the presentation, an overview of the QtScript API will be given, and techniques and patterns that are effective when developing with QtScript will be showcased.
The QtScript language is based on ECMAScript, 3rd edition, a well-known, popular language used in e.g. Mozilla and KJS/Webkit. The core ECMAScript host extension provided by QtScript is the integration with Qt's Meta-Object System, making signals, slots and properties of C++ objects available to scripts, without the developer having to write additional glue code.
After giving a quick tour of the QtScript classes and essential functions, I will illustrate the basic ways of using the API when embedding the QtScript engine. The techniques themselves are simple, but powerful, and can thus be applied to create scripting-based infrastructures of varying size and complexity. I will discuss some experiences from porting functionality in existing, pure C++ applications to hybrid solutions that use a reasonable combination of C++ and script logic; this will be of interest to those who want to do the same, and will serve to establish the best practices when designing and implementing applications that use QtScript.
Kent Hansen
I am a software engineer currently employed at Trolltech. My main responsibility is to maintain QtScript, Qt's embedded scripting environment.