Overview:
I am trying to create a PoC application that mimics WebIntents-like feature. So, in my Qt application, I create two QWebviews launching two different webApps. Now let's call them apps A and B.
Scenario:
- Main Application creates two QWebViews each launching an App i.e. AppA, AppB.
- App A is programmed to fetch some data via AJAX, automatically.
- App B also needs part of that data. AppB simply displays a button (HTML) called . Note: Since, AppA already has that info, I would like the AppB to invoke a JavaScript API which was injected into it's(appB) DOM by means of addToJavaScriptWindowObject() method call when the QWebView was launched.
- App-A completed the Ajax Call and indicates the completion in its WebView.
- User clicks the button in AppB,
- App B invokes that JavaScript API i.e. fetcData({source: "AppA");
- Now the control is in the QT-world:
Question: the Control is in the context of AppB, How should I communicate with the WebView in AppA -- i.e. AppB asks AppA: hey AppA, please give me that data that you have fetched?
Can Signals and Slots help me here? Or should I use some other form of IPC.
I read this page: http://qt-project.org/doc/qt-4.8/qtwebkit-bridge.html, but I still didn't get a hint for a solution for my problem.
Another related question: Are QWebViews created in their own threads ?