forked from qt-creator/qt-creator
Add a ShowContextMenu action
Allow users without physical MenuKey to open the context menu Change-Id: Id886a5614e26d614cba6ceb3b08a9df6148e9655 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
committed by
Jesus Fernandez
parent
9a0eca15c5
commit
f3cd5cdb7e
@@ -119,6 +119,15 @@ bool TextEditorPlugin::initialize(const QStringList &arguments, QString *errorMe
|
||||
editor->editorWidget()->invokeAssist(QuickFix);
|
||||
});
|
||||
|
||||
QAction *showContextMenuAction = new QAction(tr("Show Context Menu"), this);
|
||||
ActionManager::registerAction(showContextMenuAction,
|
||||
Constants::SHOWCONTEXTMENU,
|
||||
context);
|
||||
connect(showContextMenuAction, &QAction::triggered, []() {
|
||||
if (BaseTextEditor *editor = BaseTextEditor::currentTextEditor())
|
||||
editor->editorWidget()->showContextMenu();
|
||||
});
|
||||
|
||||
// Generic highlighter.
|
||||
connect(ICore::instance(), &ICore::coreOpened, Manager::instance(), &Manager::registerHighlightingFiles);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user