In this recipe, you will learn how to find out the distance in kilometers between the two locations entered by the user. The recipe will simply prompt the user to enter two locations, followed by clicking the Find Distance button, and the distance between the two will be displayed.
Finding out the distance between two locations
How to do it…
Let's create an application based on the Dialog without Buttons template by performing the following steps:
- Add four QLabel, two QLineEdit, and a QPushButton widget to the form by dragging and dropping four Label, two Line Edit, and a Push Button widget onto the form.
- Set the text property of the first Label widget to Find out the distance between two locations, that of the second...