Hi:
Sorry to bother again, but I did found a solution. I reimplemented the contextMenuEvent with this code:
QMenu *menu
= this
->createStandardContextMenu
();
menu->addAction(action_comment);
menu->addAction(action_uncomment);
menu->insertSeparator(action_comment);
menu->exec(event->globalPos());
}
void CodeEditor::contextMenuEvent(QContextMenuEvent *event){
QMenu *menu = this->createStandardContextMenu();
menu->addAction(action_comment);
menu->addAction(action_uncomment);
menu->insertSeparator(action_comment);
menu->exec(event->globalPos());
}
To copy to clipboard, switch view to plain text mode
action_comment/uncomment were two private objects which are created and connected in the constructor to their respective code.
I'm posting it in case it helps anyone.
Bookmarks