I've successfully added an C++ object to a QWebFrame with addToJavaScriptWindowObject, and can call a slot on that object from javascript.
But what I really want to do is have one of those slots return a new object. For example, I have a slot like this, which returns a QObject derived class instance:
MyObject* MyApp::helloWorld()
{
//MyObject is dervied from QObject
return new MyObject();
}
I can call this slot from javascript successfully like this
var foo=myapp.helloWorld();
But foo appears to be empty, I can't call any slots or access any properties on it from Javascript.
Any ideas on how I can achieve this?