aarelovich
6th October 2009, 16:50
Hello Everybody:
Simple problem here. I use a QPlainTextEdit to do a simple code editor. Now the text edit allready has a standard right-click-contex-menu and I want to add two actions (comment and uncomment). However with the code I found on the web:
action_comment = new QAction("Comment",this);
this->addAction(action_comment);
this->setContextMenuPolicy(Qt::ActionsContextMenu);
And this works but all the default options disappear and only comment appears. What I want to know is, Is there any way to add actions to the default context menu or do I have to create one from scratch if I want more actions?
Thanks for any help
Simple problem here. I use a QPlainTextEdit to do a simple code editor. Now the text edit allready has a standard right-click-contex-menu and I want to add two actions (comment and uncomment). However with the code I found on the web:
action_comment = new QAction("Comment",this);
this->addAction(action_comment);
this->setContextMenuPolicy(Qt::ActionsContextMenu);
And this works but all the default options disappear and only comment appears. What I want to know is, Is there any way to add actions to the default context menu or do I have to create one from scratch if I want more actions?
Thanks for any help