diff options
author | Jesus Fernandez <jesus.fernandez@qt.io> | 2017-06-01 17:15:35 +0200 |
---|---|---|
committer | Jesus Fernandez <Jesus.Fernandez@qt.io> | 2017-06-09 10:30:35 +0000 |
commit | f3cd5cdb7efd5bbe714f4c82d431217692647c15 (patch) | |
tree | e3cfa8015a2b558aa108d51a890c201d1c2082fe /src/plugins/texteditor/texteditorplugin.cpp | |
parent | 9a0eca15c54b7496843ace516ec301f24f39928a (diff) | |
download | qt-creator-f3cd5cdb7efd5bbe714f4c82d431217692647c15.tar.gz |
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>
Diffstat (limited to 'src/plugins/texteditor/texteditorplugin.cpp')
-rw-r--r-- | src/plugins/texteditor/texteditorplugin.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/texteditor/texteditorplugin.cpp b/src/plugins/texteditor/texteditorplugin.cpp index 4d5c4170a5..80f95ba22c 100644 --- a/src/plugins/texteditor/texteditorplugin.cpp +++ b/src/plugins/texteditor/texteditorplugin.cpp @@ -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); |