void QTextEdit::contextMenuEvent ( QContextMenuEvent * event ) [virtual protected]Shows the standard context menu created with createStandardContextMenu().
If you do not want the text edit to have a context menu, you can set its contextMenuPolicy to Qt::NoContextMenu. If you want to customize the context menu, reimplement this function.
If you want to extend the standard context menu, reimplement this function, call createStandardContextMenu() and extend the menu returned.Information about the event is passed in the event object.
void MyTextEdit::contextMenuEvent(QContextMenuEvent *event)
{
QMenu *menu = createStandardContextMenu();
menu->addAction(tr("My Menu Item"));
//...
menu->exec(event->globalPos());
delete menu;
}