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?
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: