I have two QWebView
instances(webView1
and webView2
), both of them have a same statement like this:
webView->page()->mainFrame()->addToJavaScriptWindowObject("JSCallable", parent);
which parent
refers to a same instance that have public slots for JS to invoke(i.e. both webView1
and webView2
will call the same method of the same instance), and I do call this statement whenever the webView(webView1
and webView2
) load a new URL;
Now the problem is: only one webView can call the method of parent
successfully while the other cannot.
I wonder whether it is possible to binding two webView to one obj for the purpose that the JavaScript in different pages can call a same method of a QObject
.
Any one would help? I will thank you in advance.
Qt 4.8.4 / VS2010 with Windows 7