Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5970839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:25:56+00:00 2026-05-22T20:25:56+00:00

EDIT: Too many edits :doh: I have identified the problem this time. There is

  • 0

EDIT:
Too many edits :doh:

I have identified the problem this time. There is a flaw in the way I am passing the Javascript code to the evaluatejavascript func. of QWebView.

Using Google maps’s API, when I click a pushButton attached to the slot holding the below code

this->page()->mainFrame()->evaluateJavaScript (QString ("Open(%1,2)").arg ( point.x ()).arg (point.y ()) );

the map pertaining to the location in question gets displayed.

Now if I want to add a marker to a particular coordinate, I do:

this->page()->mainFrame()->evaluateJavaScript (QString ("addMarker (%1, %2)").arg (point.x ()).arg (point.y ()) );

This code doesn’t execute. Any ideas?

Besides this, what is the way to add a user defined function to evaluateJavaScript for evaluation?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T20:25:57+00:00Added an answer on May 22, 2026 at 8:25 pm

    Finally found the answer!

    Any Javascript function which has to be called from function evaluateJavaScript is supposed to be defined in an html file (included in) the C++ source, as shown below:

    Now instead of creating a new add marker function, I have added its code in the Open function defined below:

    var map;
    
    function initialize()
    {
          if (GBrowserIsCompatible()) 
          {
                map = new GMap2(document.getElementById("map"));
                map.setCenter( new GLatLng(0,0),1 );
          }
        }
    
    function Open (x,y)
    {
        map.setCenter (new GLatLng(x,y), 13);
    
        var point = new GLatLng (x,y);
        map.addOverlay (new GMarker(point));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: Got too confusing with so many different edits, so this is where I'm
Wondering if there's any not-too-hard way to edit non-form text in html 4. I
Edit! Turns out I had just got too many apostrophes going on when calling
I get an EInOutError with message 'Too many open files' when executing this code
I'm trying to use XPath in PHP and I get too many elements. This
EDIT What small things which are too easy to overlook do I need to
Edit: This question was written in 2008, which was like 3 internet ages ago.
EDIT: This was formerly more explicitly titled: - Best solution to stop Kontiki's KHOST.EXE
EDIT: This question is more about language engineering than C++ itself. I used C++
Edit : Solved, there was a trigger with a loop on the table (read

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.