Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. Rendering webpage(supported by html5 and javascript) from server machine to client machine
Forum Updated to NodeBB v4.3 + New Features

Rendering webpage(supported by html5 and javascript) from server machine to client machine

Scheduled Pinned Locked Moved Qt WebKit
20 Posts 5 Posters 7.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mrajanna
    wrote on 9 Oct 2012, 10:05 last edited by
    #1

    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

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrajanna
      wrote on 9 Oct 2012, 11:12 last edited by
      #2

      Hello,
      Could someone please reply me ??
      Regards
      Mohan

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goetz
        wrote on 9 Oct 2012, 18:24 last edited by
        #3

        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.

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply
        0
        • T Offline
          T Offline
          TioRoy
          wrote on 9 Oct 2012, 22:04 last edited by
          #4

          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?

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mrajanna
            wrote on 10 Oct 2012, 04:49 last edited by
            #5

            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]

            1 Reply Last reply
            0
            • A Offline
              A Offline
              AcerExtensa
              wrote on 10 Oct 2012, 13:04 last edited by
              #6

              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...

              God is Real unless explicitly declared as Integer.

              1 Reply Last reply
              0
              • M Offline
                M Offline
                mrajanna
                wrote on 10 Oct 2012, 13:15 last edited by
                #7

                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]

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  AcerExtensa
                  wrote on 10 Oct 2012, 13:51 last edited by
                  #8

                  Does it works with other browsers?

                  God is Real unless explicitly declared as Integer.

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    mlong
                    wrote on 10 Oct 2012, 14:31 last edited by
                    #9

                    mrajanna, please be sure and wrap code snippets with @ tags so that they are formatted correctly. Thanks!

                    Software Engineer
                    My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      mrajanna
                      wrote on 10 Oct 2012, 15:35 last edited by
                      #10

                      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.

                      1 Reply Last reply
                      0
                      • T Offline
                        T Offline
                        TioRoy
                        wrote on 10 Oct 2012, 15:48 last edited by
                        #11

                        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.

                        1 Reply Last reply
                        0
                        • M Offline
                          M Offline
                          mlong
                          wrote on 10 Oct 2012, 15:48 last edited by
                          #12

                          bq. Hello mlong,
                          Iam sorry, I din’t understand you.

                          See here for more details:

                          http://qt-project.org/wiki/ForumHelp#e3f82045ad0f480d3fb9e0ac2d58fb01

                          Software Engineer
                          My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

                          1 Reply Last reply
                          0
                          • M Offline
                            M Offline
                            mrajanna
                            wrote on 10 Oct 2012, 16:16 last edited by
                            #13

                            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?

                            1 Reply Last reply
                            0
                            • T Offline
                              T Offline
                              TioRoy
                              wrote on 10 Oct 2012, 17:00 last edited by
                              #14

                              I think you should follow the link.

                              1 Reply Last reply
                              0
                              • M Offline
                                M Offline
                                mlong
                                wrote on 10 Oct 2012, 17:42 last edited by
                                #15

                                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.

                                Software Engineer
                                My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

                                1 Reply Last reply
                                0
                                • M Offline
                                  M Offline
                                  mrajanna
                                  wrote on 11 Oct 2012, 05:24 last edited by
                                  #16

                                  mlong,
                                  I shall take care of your point.

                                  I am still not able to fix the problem. Could someone help me.

                                  Thanks
                                  Mohan

                                  1 Reply Last reply
                                  0
                                  • A Offline
                                    A Offline
                                    AcerExtensa
                                    wrote on 11 Oct 2012, 07:05 last edited by
                                    #17

                                    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)...

                                    God is Real unless explicitly declared as Integer.

                                    1 Reply Last reply
                                    0
                                    • M Offline
                                      M Offline
                                      mrajanna
                                      wrote on 11 Oct 2012, 08:04 last edited by
                                      #18

                                      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 ?

                                      1 Reply Last reply
                                      0
                                      • T Offline
                                        T Offline
                                        TioRoy
                                        wrote on 11 Oct 2012, 22:34 last edited by
                                        #19

                                        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?

                                        1 Reply Last reply
                                        0
                                        • M Offline
                                          M Offline
                                          mrajanna
                                          wrote on 12 Oct 2012, 05:59 last edited by
                                          #20

                                          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 2012

                                          I download Qt5 from below link:
                                          http://releases.qt-project.org/qt5.0/beta1/qt-linux-opensource-5.0.0-beta1-x86-ubuntu1204-offline.run

                                          After 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 Reply Last reply
                                          0

                                          1/20

                                          9 Oct 2012, 10:05

                                          • Login

                                          • Login or register to search.
                                          1 out of 20
                                          • First post
                                            1/20
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved