PDA

View Full Version : Binding a class into Qt script engine



kaspi
5th December 2010, 07:48
Hello,

I'd like to bind a class from C++, say MyClass, to my QtScript engine. So a user could then create an object of it, e. g.:


var usersObjectOfMyClass = new MyClass("someArg");
usersObjectOfMyClass.doSomething();

Is it possible to predefine such classes in C++ that could be exposed and instantiated using the "new" word inside the ECMAScript?

tbscope
5th December 2010, 08:54
http://doc.qt.nokia.com/4.7/scripting.html