
Originally Posted by
high_flyer
I gave you the 'guide', what more do you need?
1. create a slot
2. connect the clicked() signal to that slot
3. in the slot emit the event
in the book c++ gui programming with qt4 i found another way{create an action, populate a menu, connect the menu with button}
oneAction
= new QAction("do something!!",
this);
connect(oneAction, SIGNAL(triggered()), this, SLOT(action()));
processMenu->addAction(oneAction);
menuButton->setMenu(&processMenu);
oneAction= new QAction("do something!!", this);
connect(oneAction, SIGNAL(triggered()), this, SLOT(action()));
processMenu->addAction(oneAction);
menuButton->setMenu(&processMenu);
To copy to clipboard, switch view to plain text mode
what is the difference? between these 2 ways?
Bookmarks