What am I doing wrong?
It can happen if you omit to declare the slot as a real slot. You can either use the Q_SLOTS
macros for that or just simply slots
. In your case, the latter is more adequate because it is just an application and a mainwindow.
You also need to make sure you do not forget to use the Q_OBJECT
macro in your header file.