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 has been added to the source code: ...