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:
Although using QObject::sender() is perfectly fine, the idealistic approach would be QSignalMapper
QObject::sender()