Displaying location on Google Maps
In this recipe, you will learn how to display a location on Google Maps if you know the longitude and latitude values of that location. You will be prompted to simply enter longitude and latitude values and, when you click the Show Map
button, that location will appear on Google Maps.
How to do it…
Let's create an application based on the Dialog without Buttons
template by performing the following steps:
- Add two
QLabel
, twoQLineEdit
, aQPushButton
, and aQWidget
widget to the form by dragging and dropping twoLabel
, twoLine Edit
, aPush Button
, and aWidget
container onto the form. - Set the text property of the two
Label
widgets toLongitude
andLatitude
. - Set the
text
property of thePush Button
widget toShow Map
. - Set the
objectName
property of the twoLine Edit
widgets tolineEditLongitude
andlineEditLatitude
. - Set the
objectName
property of thePush Button
widget topushButtonShowMap
. - Save the application by name as
showGoogleMap.ui
. The form will now appear...