PDA

View Full Version : Can we Initialize objects of c++ class in javascript file?



coolmac
16th July 2008, 15:35
Hi all,
If I have a class say MyApp and I am establishing a connection with a javascript file using some signal and object of this class.Now can we initialize some othe object of this class in .js file??like
var obj1=new MyApp;
and then access its methods??
Is this possible and wats the right way to implement it??

jacek
25th July 2008, 23:44
See the QtScript Calculator example. You have to create QObject in C++ and make it available to the script using QScriptEngine::newQObject().