1.11.1. Exercises: Qt Dialogs for User Input/Output

The exercises in this section are all based on Example 1.15. You can find most answers in the Qt Reference API Documentation.

[ fromfile: qtfirstapp.xml id: ex-qtfirstapp ]

  1. How can you fix the program so that it performs no calculation and exits the loop if the user clicks cancel?

  2. At the moment, the program does not check to see if the user enters a negative number. How can you fix it to ensure that negative numbers are never accepted?