×

Discussion Board

Results 1 to 13 of 13

Thread: QWebView

  1. #1
    Registered User
    Join Date
    Dec 2009
    Posts
    22

    QWebView

    Hi all, I'm trying to display a javascript map on QWebView but seems like it did not display on the S60 Emulator.

    The following are the codes:
    QString stringMap = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>"
    "<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en' xmlns:v='urn:schemas-microsoft-com:vml'>"
    "<head>"
    "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>"
    "</head>"
    "<body>"
    "<div id='map' style='width:100px;height:200px;'></div>"
    "<script type='text/javascript' src='http://gothere.sg/jsapi?sensor=false'></script>"
    "<script type='text/javascript'>"
    "gothere.load('maps');"
    "function initialize() {"
    "// Create the Gothere map object."
    "var map = new GMap2(document.getElementById('map'));"
    "// Set the center of the map."
    "map.setCenter(new GLatLng(1.29297, 103.8523), 16);"
    "}"
    "gothere.setOnLoadCallback(initialize);"
    "</script>"
    "</body>"
    "</html>";
    ui->qWebView->setHtml(stringMap);
    Any idea what's the problem? I tried to replace the content in the body tag to a simple "Hi" and it displayed on the phone. So I was wondering is it that QWebView does not support javascript? Thanks in advance!

  2. #2
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    286

    Re: QWebView

    Quote Originally Posted by windcor View Post
    So I was wondering is it that QWebView does not support javascript? Thanks in advance!
    QWebView does support javascript. there must be something else here...

  3. #3
    Registered User
    Join Date
    Dec 2009
    Posts
    22

    Re: QWebView

    I see. Is there anyway to display a javascript map on S60?

  4. #4
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326
    Last edited by divanov; 2010-02-04 at 08:37.

  5. #5
    Registered User
    Join Date
    Dec 2009
    Posts
    22

    Re: QWebView

    Quote Originally Posted by divanov View Post
    Thanks for the reply.
    Do you have any example for that? I tried to use that but seems to be not working too..

  6. #6
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: QWebView

    I slightly modified your application to output messages to the console:
    http://www.mediafire.com/file/zywnm5wxzui/maps.tar.gz
    It works fine on my N900 and on my Ubuntu desktop.
    The actual question is there any console on Symbian phone?

  7. #7
    Registered User
    Join Date
    Dec 2009
    Posts
    22

    Re: QWebView

    Quote Originally Posted by divanov View Post
    I slightly modified your application to output messages to the console:
    http://www.mediafire.com/file/zywnm5wxzui/maps.tar.gz
    It works fine on my N900 and on my Ubuntu desktop.
    The actual question is there any console on Symbian phone?
    Thanks for the example! Really appreciate it. However, I tried deploying it on Nokia 5800 but it was a blank screen. I tried running on the S60 emulator and it also displayed as blank.

  8. #8
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: QWebView

    It would be nice, if somebody with Symbian background could join the discussion. I've heard on Symbian you can write log messages to the file and then analyse them. The reason it might not work is your application doesn't have an internet connection, thus, is not able to load external JavaScript and then the actual map. To say more output of the log is needed.

  9. #9
    Registered User
    Join Date
    Dec 2009
    Posts
    22

    Re: QWebView

    Quote Originally Posted by divanov View Post
    It would be nice, if somebody with Symbian background could join the discussion. I've heard on Symbian you can write log messages to the file and then analyse them. The reason it might not work is your application doesn't have an internet connection, thus, is not able to load external JavaScript and then the actual map. To say more output of the log is needed.
    Thanks! I really hope that the problem can be solved..

  10. #10
    Registered User
    Join Date
    Dec 2009
    Posts
    22

    Re: QWebView

    Hi, I've tried deploying the following example on the symbian phone and its working! But it is using Google Map and I need to switch to another javascript map. However, I tried to change the codes but still didn't manage to get it work. Can any expert guide me along?

    The example that works:
    http://wiki.forum.nokia.com/index.ph...n:_Google_maps

    The javascript map that I wish to use:
    http://gowhere.sg/api/maps/examples/basic-map.html

    Possible if someone help me with the code? Thanks!

  11. #11
    Registered User
    Join Date
    Dec 2009
    Posts
    22

    Re: QWebView

    Issue resolved! Managed to make it work in QWebView!

  12. #12
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: QWebView

    It could be beneficial to other people facing the same issue in the future, if you explain what was the problem.

  13. #13
    Registered User
    Join Date
    Nov 2009
    Posts
    37

    Re: QWebView

    Quote Originally Posted by windcor View Post
    Issue resolved! Managed to make it work in QWebView!
    come on guy,could you please explain how did you reslove this issue in detail and copy your code here, I really want to know it.

Similar Threads

  1. QWebView
    By atonical in forum Qt
    Replies: 1
    Last Post: 2011-02-13, 19:14

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×