I have a QMenu and actions added to it. Works fine. Assume it does have menu called "Paste here" in it.
So now I have 3 buttons, I assign this same menu to three buttons:
btnNum1->setMenu(MyMenu);
btnNum2->setMenu(MyMenu);
btnNum3->setMenu(MyMenu);
Now in the triggered slot, when I do:
qDebug() << QObject::sender();
I get the QAction
which is the submenu item, I want to know which button invoked the menu which then user clicked on a menu item and triggered the slot. I need to know is it menu loaded in btnNum1
or btnNum2
or btnNum3
.
Is it even possible?