forked from qt-creator/qt-creator
add standard cut/copy/paste actions (if available) to the cpp editor's context menu
at a later stage we will look into harmonizing context menu among different editors. The cpp editor had the biggest need, because its context menu features all sorts of extra refactoring operations, thus the standard Qt context menu became too large.
This commit is contained in:
@@ -1643,14 +1643,6 @@ void CPPEditor::contextMenuEvent(QContextMenuEvent *e)
|
||||
|
||||
QMenu *menu = new QMenu();
|
||||
|
||||
|
||||
// QMenu *menu = createStandardContextMenu();
|
||||
//
|
||||
// // Remove insert unicode control character
|
||||
// QAction *lastAction = menu->actions().last();
|
||||
// if (lastAction->menu() && QLatin1String(lastAction->menu()->metaObject()->className()) == QLatin1String("QUnicodeControlCharacterMenu"))
|
||||
// menu->removeAction(lastAction);
|
||||
|
||||
Core::ActionManager *am = Core::ICore::instance()->actionManager();
|
||||
Core::ActionContainer *mcontext = am->actionContainer(CppEditor::Constants::M_CONTEXT);
|
||||
QMenu *contextMenu = mcontext->menu();
|
||||
@@ -1661,6 +1653,8 @@ void CPPEditor::contextMenuEvent(QContextMenuEvent *e)
|
||||
const QList<QTextEdit::ExtraSelection> selections =
|
||||
extraSelections(BaseTextEditor::CodeSemanticsSelection);
|
||||
|
||||
appendStandardContextMenuActions(menu);
|
||||
|
||||
menu->exec(e->globalPos());
|
||||
delete menu;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user