title: Qt QWebView and passing data from JavaScript
body: <p>I've got a Qt program where a user can select the location by Google Maps. I'm using a simple HTML file for creating the map and load this file in the QWebView control:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta name="viewport" content="initial-scale=1.0, user-scalable=no" /&gt;
      &lt;style type="text/css"&gt;
          html
          {
              height: 100%;
          }
          body
          {
              height: 100%;
              margin: 0;
              padding: 0;
          }
          #map_canvas
          {
              height: 100%;
          }
      &lt;/style&gt;
  
      &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"&gt;&lt;/script&gt;
  
      &lt;script type="text/javascript"&gt;
          function initialize() {
              var latlng = new google.maps.LatLng(-34.397, 150.644);
  
              var myOptions = {
                  zoom: 8,
                  center: latlng,
                  mapTypeId: google.maps.MapTypeId.ROADMAP
              };
  
              var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  
              google.maps.event.addListener(map, "click", function (event) {
  
                  var geoLocationUrl = 'http://maps.googleapis.com/maps/api/geocode/xml?latlng='
                  + event.latLng.lat() + "," + event.latLng.lng() + "&amp;sensor=false";
  
                  console.log(geoLocationUrl);
  
                  $.ajax({
                      type: "GET",
                      url: geoLocationUrl,
                      dataType: "xml",
                      success: function (xml) {
  
                      },
                      error: function () {
  
                      }
  
  
                  });
              });
          }
  
          function showLocation(location) {
  
          }
  
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body onload="initialize()"&gt;
      &lt;div id="map_canvas" style="width: 100%; height: 100%"&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The question is how to pass data after an ajax request to the Qt C++ code. I know that I can evalute a javascript function in Qt C++ but in this case the task is reverse. </p>