guitreize at gmail.com
Wed Aug 17 02:43:38 PDT 2011
Ok, for those interested, the solution is this one:
1. add a classical object to the window object:
2. Execute a small JS code to your frame to setup a window function:
window.myObject.myFunction(args); }" );
There's no way to add a function to the window object with only C++
code; at least not that I know of.
On Tue, Aug 16, 2011 at 5:15 PM, Guillaume BIENKOWSKI
<guitreize at gmail.com> wrote:
> Hey guys,
> by QtWebkit in all its pages.
> I know how to add an _object_ to this window object, proceeding like
> this in my QWebView:
>> QWebFrame *frame = page()->mainFrame();
>> MyObject *object = new MyObject();
> And then, thanks to the magics of Qt (here:
>> window.myObject.mySlot( argument );
>> window.myFunction( argument );
> How can I add the "myFunction" _function_ to the window object?
> I looked into the QWebFrame object to see what this function does, but
> it seems that the window object is not easily reachable from the Qt
> Any idea?
More information about the webkit-qt