Rendering webpage(supported by html5 and javascript) from server machine to client machine
-
wrote on 9 Oct 2012, 10:05 last edited by
Hello Group,
I am running QT webkit application on client system. My requirement is to render the web page (implemented using html5 and javascript) running on server and show it on Qwebview widget of client.
In my code:
ui->webView->load(QUrl("http://10.102.68.51:8080"));;
Above code is properly populating Qwebview widget with server page on client. But the problem is there is a graph getting plotted dynamically on server web page using javascript, this graph is not getting plotted on client system.
Can someone please guide me.
Thanks
Mohan -
wrote on 9 Oct 2012, 11:12 last edited by
Hello,
Could someone please reply me ??
Regards
Mohan -
wrote on 9 Oct 2012, 18:24 last edited by
First off: Please be patient. Pushing your topic after only one hour is impolite and may cause you getting no answers at all.
Did you have a look at [[doc:QWebSettings]] already? Maybe you need to tweak some of the settings there.
-
wrote on 9 Oct 2012, 22:04 last edited by
If I correctly undertand, the problem isn't in the code, but on the page (HTML).
Can you post the link (img src) to the graph?
-
wrote on 10 Oct 2012, 04:49 last edited by
Hello Volker,
Sorry for being impatient. I thought if I send a reminder, someone would respond immmediately. I shall not repeat this :)
I tried with below Qwebsettings but still no solution. Can I know the specific Qwebsettings that can be used.
@
ui->webView->load(QUrl("http://10.102.68.51:8080/Appli"));ui->webView->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); ui->webView->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
@
Hello TioRoy,
If I try to launch the link in chromium browser, everthing works fine. I predict its not a problem with html.Thanks
Mohan[Edit: Added @ tags around code -- mlong]
-
wrote on 10 Oct 2012, 13:04 last edited by
If your graph plotted by the javascript you should enable javascript in webcore.
@ui->webView->settings()->setAttribute(QWebSettings::JavascriptEnabled, true);@P.S.: also, set settings before loading web page...
-
wrote on 10 Oct 2012, 13:15 last edited by
Hello AcerExtensa
I tried below code but still no solution.
@
ui->webView->settings()->setAttribute(QWebSettings::JavascriptEnabled, true);
ui->webView->settings()->setAttribute(QWebSettings::JavascriptCanOpenWindows, true);
ui->webView->settings()->setAttribute(QWebSettings::JavascriptCanAccessClipboard, true);
ui->webView->settings()->setAttribute(QWebSettings::JavaEnabled, true);
ui->webView->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
ui->webView->settings()->setAttribute(QWebSettings::LocalStorageEnabled, true);ui->webView->load(QUrl("http://10.102.68.51:8080/Appli"));
@
[Edit: Added @ tags around code -- mlong]
-
wrote on 10 Oct 2012, 13:51 last edited by
Does it works with other browsers?
-
wrote on 10 Oct 2012, 14:31 last edited by
mrajanna, please be sure and wrap code snippets with @ tags so that they are formatted correctly. Thanks!
-
wrote on 10 Oct 2012, 15:35 last edited by
AcerExtensa,
If I run "http://10.102.68.51:8080/Appli" on chromium browser, it perfectly works. However in Mozilla, it only displays web page and its contents but graph is not getting plotted. I just want to remind you, graph is plotted using javascript.
Hello mlong,
Iam sorry, I din't understand you. -
wrote on 10 Oct 2012, 15:48 last edited by
mrajanna,
You need to check for javascript errors.
You can implement a class derived from QWebPage, and reimplement the javaScriptConsoleMessage.
Check "this":http://www.developer.nokia.com/Community/Wiki/Redirecting_JavaScript_console_messages_in_a_Qt_hybrid_application page.
-
wrote on 10 Oct 2012, 15:48 last edited by
bq. Hello mlong,
Iam sorry, I din’t understand you.See here for more details:
http://qt-project.org/wiki/ForumHelp#e3f82045ad0f480d3fb9e0ac2d58fb01
-
wrote on 10 Oct 2012, 16:16 last edited by
mLong,
FYI: web page ( html5 and javascript) is running on server(system near my system) and I am able to render that page on my system using Qtwebkit and display on Qwebview widget of my system. This mean I am able to render the page, but the problem is graph getting plotted in web page of server is not visible on my system.
Excuse me if I am wrong, whether should I still follow the link provided by you?
-
wrote on 10 Oct 2012, 17:00 last edited by
I think you should follow the link.
-
wrote on 10 Oct 2012, 17:42 last edited by
mrajanna, as a forum moderator, I was referring to your posts on the forum (formatting your code in your messages, etc.) not responding to your question proper.
-
wrote on 11 Oct 2012, 05:24 last edited by
mlong,
I shall take care of your point.I am still not able to fix the problem. Could someone help me.
Thanks
Mohan -
wrote on 11 Oct 2012, 07:05 last edited by
bq. I am able to render that page on my system using Qtwebkit and display on Qwebview widget
so, if it works correctly, the problem is somewhere else...
bq. graph getting plotted in web page of server
You have when problem with your server(what ever it is)... What do you mean with "server" at all? some kind of software what do some work and outputs html page? What is it? Is it even Qt software or what?
I don't think we can help you without code samples(I mean html page what you got from server)...
-
wrote on 11 Oct 2012, 08:04 last edited by
FYI server side configurations: Tomcat server running html5 page embedded with JSF script on server side. Tomcat uses RFC 6455 websocket protocol.
Observation made:
I just discovered the problem by using wireshark.a) When request is sent from chromium browser client, it uses RFC 6455 websocket protocol. Hence it works. b) But Websocket protocol used by Qtwebkit is something other than RFC 6455. So only connection is getting established with server but data transmission does not happen.
Is there is a way to add patch to QtWebkit to support RFC 6455 protocol ?
-
wrote on 11 Oct 2012, 22:34 last edited by
Each browser (like QTWebKit) implements websockets differently. Check "this":http://en.wikipedia.org/wiki/WebSocket and "this":http://en.wikipedia.org/wiki/Comparison_of_WebSocket_implementations.
I guess qtwebkit uses "hybi-07":http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-07 (check this "thread":http://qt-project.org/forums/viewthread/10106). But checking Qt5 sources, I think it uses hybi-10.
Which version of Qt do you use?
-
wrote on 12 Oct 2012, 05:59 last edited by
TioRoy,
From the Makefile generated for .pro file from qmake command, I see
#Generated by qmake (2.01a) (Qt 4.8.1) on: Fri Oct 12 05:49:57 2012I download Qt5 from below link:
http://releases.qt-project.org/qt5.0/beta1/qt-linux-opensource-5.0.0-beta1-x86-ubuntu1204-offline.runAfter using Qt5, Now I observe graph is getting plotted properly. My problem is solved :)
Thanks for spending your time in answering my questions.
Thanks to Qt5 too.
Regards
Mohan
1/20