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 for the push button. Let's select the clicked() option and press OK. A slot function called on_pushButton_clicked() will now appear in both mainwindow.h and mainwindow.cpp. Qt Creator automatically added the slot ...