In the previous example, we demonstrated the use of signals and slots on a push button. Now, let's explore the signals and slots that are available in other common widget types.
UI events with signals and slots
How to do it...
To learn how to use signals and slots with UI events, follow these steps:
- Let's create a new Qt Widgets Application project.
- Drag and drop a Push Button, Combo Box, Line Edit, Spin Box, and Slider from the Widget Box into your UI canvas:
- Then, right-click on the push button and select clicked() and press the OK button to proceed. A slot function will be created for you by Qt Creator:
- Repeat the previous step, but this time, select the next selection until every function in QAbstractButton...