[Qt-interest] Regarding scripting and QT
Patric
userqt at gmail.com
Wed Aug 25 22:47:02 CEST 2010
Thanks for the answers. :)
Best Regards,
Patric
On 25.8.2010 г. 22:04, Bastian Bense wrote:
> Hi,
>
> basically making applications scriptable is very common. There are a number of languages (one of my favourites being Lua for being so small and embeddable).
>
> If you are new to this but are familiar with Qt, you should start with QtScript. The general workflow is as follows:
>
> - Create a QObject based class that has "public slots" (those will be available to the scripting environment)
> - For more functionality also let your class inherit from QScriptable (this gives you access to the engine, method context, etc).
> - Create a new QScriptEngine and use use newQObject() to register your class instance with the script engine, then use myEngine.globalObject().setProperty("myObj", myObjInstance) to make the object available as global variable
> - Execute the script code using evaluate()
>
> You'll get a feeling for the whole process rather quick.
> Also check the examples and the very good documentation that comes with Qt.
>
> Hope that helps. :)
>
>
> Basti
>
> Am 25.08.2010 um 19:34 schrieb Patric:
>
>> can someone please give me a simple description of the scripting idea
>> and it's connection with QT ? This is the first time I hear something
>> about "making C++ app scriptable". It seems there is not much general
>> information on the net regarding this topic.
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
More information about the Qt-interest-old
mailing list