How it works…
You can see in the script that the click event of the push button with the objectName property pushButtonSearch s connected to the displayDetails method. This means that, whenever the push button is clicked, the displayDetails method will be invoked. In the displayDetails method, you access the location entered by the user in the Line Edit widget and assign that location to the address variable. You define a Google Maps instance by passing the API key that you got on registering with Google. Invoke the search method on the Google Maps instance, passing the location entered by the user in this method. The result of the search method is assigned to the my_location structure. The city member of the my_location structure contains ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access