To understand how data is accepted by the user and how type casting is done, let's create an application based on the Dialog without Buttons template by performing the following steps:
- Add three QLabel, two QLineEdit, and one QPushButton widget to the form by dragging and dropping three Label, two Line Edit, and four Push Button widgets on the form.
- Set the text property of the two Label widgets to Enter First Number and Enter Second Number.
- Set the objectName property of the three Labels to labelFirstNumber, labelSecondNumber, and labelResult.
- Set the objectName property of the two Line Edit widgets to lineEditFirstNumber and lineEditSecondNumber.
- Set the objectName property of the four Push Button widgets to pushButtonPlus ...