Two slots are defined according to the automatic connection naming convention required by uic. This is to ensure that QMetaObject's auto-connection facilities connect all the signals and slots involved automatically.

CalculatorForm Implementation

In the constructor, we call setupUi() to load the user interface file. Note that we do not need the ui prefix as CalculatorForm is a subclass of the user interface class.

We include two slots, on_inputSpinBox1_valueChanged() and on_inputSpinBox2_valueChanged(). These slots respond to the valueChanged() signal that both spin boxes emit. Whenever there is a change in one spin box's value, we take that value and add it to whatever value the other spin box has.

There are various approaches to include forms into applications. The Multiple Inheritance approach is just one of them. See Using a Designer UI File in Your Application for more information on the other approaches available.