×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    331

    How to display Google Map Details in another Qt UI

    Hi Friends,

    I am working on a project that will fetch data from the google map and should display the fetched data in another UI window.

    Currently, I am able to display the google marker and the respective marked data on QWebView control after a single left mouse click. But I want to redirect these displayed data to another UI Window.

    I don't know how to perform this operation. If any body has any idea, please share with me.

    Kindly go through the following link to access the whole project I have done so far:

    http://www.mediafire.com/file/ed2580...46/showmap.rar


    Thanks,
    Rajeev

  2. #2
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    331

    Re: How to display Google Map Details in another Qt UI

    Hi... this is just an update:

    I followed Form Extractor Example as a solution to the problem. Here also I am facing some issues.

    Please check the example details:

    http://doc.qt.nokia.com/4.6/webkit-formextractor.html

    As per the above link I tried to build the Form Extractor Project, but I am confused after the Submit button is clicked, because I don't know which "Q_SIGNALS" of "qwebframe.h" is called.:

    The example don't have the "form.html" that is required to load, so I developed my own "form.html".

    The contents of my modified "form.html" is:

    <!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">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Form Extractor Example</title>
    </head>

    <body onload="" onunload="" topmargin="0" leftmargin="0">
    <div id="map" style="width: 341px; height: 271px"></div>
    <form name="myform" >
    <div align="center">
    <br><br>
    First name:
    <input name= "firstname" type="text" size="25" value="">
    <br>
    Last name:
    <input name= "lastname" type="text" size="25" value=""><br>
    Gender:
    <input type="radio" name="group1" value="Male" checked>Male<br/>
    <input type="radio" name="group1" value="Female"> Female<br/>
    <input name= "check" type="checkbox" size="25" value="" /> Check here if you would like to receive regular updates from us: <br>
    <input type=submit value = "Sumbit"/>

    </div>
    </form>
    </body>
    </html>
    The modified "formextractor.cpp" file is:

    #include "formextractor.h"

    #include <QWebElement>

    FormExtractor::FormExtractor(QWidget *parent, Qt::WFlags flags)
    : QWidget(parent, flags)
    {
    ui.setupUi(this);
    ui.webView->setUrl(QUrl("qrc:/form.html"));
    connect(ui.webView->page()->mainFrame(), SIGNAL(loadFinished()),this, SLOT(populateJavaScriptWindowObject()));
    connect(ui.webView->page()->mainFrame(), SIGNAL(loadFinished()), this, SLOT(submit()));
    //connect(ui.webView->page()->mainFrame(), SIGNAL(loadStarted()), this, SLOT(submit()));
    //connect(ui.webView->page()->mainFrame(), SIGNAL(initialLayoutCompleted()), this, SLOT(submit()));
    //connect(ui.webView->page()->mainFrame(), SIGNAL(provisionalLoad()), this, SLOT(submit()));
    //connect(ui.webView->page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(submit()));

    resize(300, 300);
    }

    FormExtractor::~FormExtractor()
    {
    }

    void FormExtractor::submit()
    {
    QWebFrame *frame = ui.webView->page()->mainFrame();

    QWebElement firstName = frame->findFirstElement("#firstname");
    QWebElement lastName = frame->findFirstElement("#lastname");
    QWebElement maleGender = frame->findFirstElement("#genderMale");
    QWebElement femaleGender = frame->findFirstElement("#genderFemale");
    QWebElement updates = frame->findFirstElement("#updates");

    ui.firstNameEdit->setText(firstName.evaluateJavaScript("this.value").toString());
    ui.lastNameEdit->setText(lastName.evaluateJavaScript("this.value").toString());

    if (maleGender.evaluateJavaScript("this.checked").toBool())
    ui.genderEdit->setText(maleGender.evaluateJavaScript("this.value").toString());
    else if (femaleGender.evaluateJavaScript("this.checked").toBool())
    ui.genderEdit->setText(femaleGender.evaluateJavaScript("this.value").toString());

    if (updates.evaluateJavaScript("this.checked").toBool())
    ui.updatesEdit->setText("Yes");
    else
    ui.updatesEdit->setText("No");
    }

    void FormExtractor:opulateJavaScriptWindowObject()
    {
    ui.webView->page()->mainFrame()->addToJavaScriptWindowObject("formExtractor", this);
    }

    By looking this example please figure out the problem!!!

    Thanks....
    Last edited by RajeevSahu; 2010-08-03 at 06:56.

  3. #3
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    331

    Re: How to display Google Map Details in another Qt UI

    Hello friends...

    Any suggestions on this issue???

Similar Threads

  1. Google map can not display corrected
    By quangndba in forum Symbian Networking & Messaging (Closed)
    Replies: 4
    Last Post: 2010-04-20, 09:51
  2. Google Map
    By RupeshD in forum Mobile Java General
    Replies: 6
    Last Post: 2009-04-09, 01:53
  3. Replies: 2
    Last Post: 2009-02-13, 03:19
  4. Google map
    By krtrivdi in forum Symbian
    Replies: 9
    Last Post: 2008-12-09, 19:43

Posting Permissions

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