The signals and slots mechanism has gone through some changes in the recent version of Qt, most notably its coding syntax. Qt 5 continues to support the older syntax for future releases, but there is no mention of how long it will be before it will be dropped completely. Therefore, it's better for us to start learning the new syntax before that day comes.
Let's get started by following these steps:
- Let's create a Qt Widgets Application project and open up mainwindow.ui.
- Drag and drop a PushButton from the Widget Box to the UI canvas:
- Right-click on the PushButton and select Go to slot. A window will appear:
- You will see a list of built-in slot functions available...