Sending external events to QtWebView components
Here is my requirement.
Will it be possible using in QT? If so what is the approach [ classes i should look into]?
And the screen display is controlled by different process and and user inputs [button clicks] will not be available to Qt webview directly. But they can be available to [x,y] coordinate to Qt application. If so, how these clicks can be processed inside the application.
Please guide me the approach.
Inotially i though of using Node.JS with websockets support where the external events [JSON] will be given to html loaded through QT. Unfortunately Node.JS and websockets support is not available, so i have do find different approach to receive the events from various processes.
You can capture data from socket by using "qtcpsocket":http://qt-project.org/doc/qt-5.1/qtnetwork/qtcpsocket.html class.
where el is QWebElement, which may be found by css selector.
My further question is, if i have html page loaded through QtWebView
var exampleSocket = new WebSocket("ws://www.example.com/socketserver", "protocolOne");
Can Qtwebkit latest supports 'Websocket' and "ws://"?
Yes, Webkit supports web socket. If you are looking for examples : "start from this":https://gitorious.org/qtwebsocket
EDIT : I think the above example does not support secure ws. Otherwise works fine. The Qt5 & Qt4 Port are slightly different.
You can make use of the Bridge APIs, so that your c++ objects can be exposed to JS environment.