In my Qt app, I create some of my widgets dynamically. Among them are QToolButtons that need to have a similar behavior.
Here is how the widgets are created:
Use QObject::sender() inside your slot to get the Sender. It will return the object that emit the signal. hope this helps.
QObject::sender()