I was wondering, once a clicked() is emitted by a button is there any way of finding out what button emitted it without overloading the click() function? (I have a bunch of buttons with almost the same function but different text, which is the defining element of each button).
Thanks in advance!
Within your slot, you can call the
sender()function to get the QObject that sent you theclicked()signal. It returns aQObject *. Useqobject_castto cast theQObject *toQPushButton *.Documentation here.