Quote Originally Posted by aamer4yu View Post
Set the text in the slot for QAction::trigerred signal.
something like -
Qt Code:
  1. void someClass::someSlot()
  2. {
  3. QAction *action = (QAction*)sender();
  4. action->setText( action->text() == "Open" ? "Close" : "Open" );
  5. }
To copy to clipboard, switch view to plain text mode 
Hi Aamer,
Thanks for replying to this message. Actually I need to implement toggle action for context menu. But only one text can be added to QAction, like QAction( _icon, _text, _parent ). In my case i need both "Open" and "Close" for the same action. But it should be toggled. Can u tell me how to implement.