connecting Pop up Menu List to actions/functions
Re: connecting Pop up Menu List to actions/functions
QAction has a triggered() signal which is emitted when the user activates the menu entry representing the action
Cheers,
_
Re: connecting Pop up Menu List to actions/functions
This is what I have
Code:
void MainWindow::slPopUpMenu()
{
newMenu
->addAction
(new QAction("Do that",
this));
}
how do get to the slot of the created action
after it is triggered
Im not seeing it!
I even tried creating a action on the form, then I was able to go to slot
but that how do I add that action to my menu?
Re: connecting Pop up Menu List to actions/functions
Quote:
Originally Posted by
ebsaith
This is what I have
Code:
void MainWindow::slPopUpMenu()
{
newMenu
->addAction
(new QAction("Do that",
this));
}
how do get to the slot of the created action
after it is triggered
Im not seeing it!
As I said, connect to the action's triggered() signal
Code:
connect(action, SIGNAL(triggered()), this, SlOT(doThatSlot()));
newMenu->addAction(action);
Cheers,
_