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 aQWidgetwidget to the form by dragging and dropping twoLabel, twoLine Edit, aPush Button, and aWidgetcontainer onto the form. - Set the text property of the two
Labelwidgets toLongitudeandLatitude. - Set the
textproperty of thePush Buttonwidget toShow Map. - Set the
objectNameproperty of the twoLine Editwidgets tolineEditLongitudeandlineEditLatitude. - Set the
objectNameproperty of thePush Buttonwidget topushButtonShowMap. - Save the application by name asÂ
showGoogleMap.ui. The form will now appear...