PDA

View Full Version : How to call the C++ member function from the JScript



parusri
18th October 2008, 00:01
Hi,

We have a requirement in QT that i have C++ class contains data and member functions.
I will pass an object to Javascript function, i should be able to call any of the member functions from Javascript.

Please help me, i will really appreciate you.

Ex:

function Add(myObj) //myObj C++ object
{
this.myObj = myObj;
var a = display();
return a;
}

Regards
Srinivas

jpn
18th October 2008, 11:13
See QScriptable class and the Qt Script (http://labs.trolltech.com/page/Projects/DevDays/DevDays2007) presentation from DevDays2007 (search for "Qt Script Prototype Objects").