FancyLineEdit: Make completers triggerable via Ctrl+Space

In particular, this allows to trigger the completer without providing a
leading character, thus showing all history entries.

Task-number: QTCREATORBUG-17891
Change-Id: I8ae900d196de2e5083a626faa757648637b325ae
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Christian Kandeler
2019-08-27 14:16:24 +02:00
parent 0ba729e527
commit 5f845a02cd
3 changed files with 52 additions and 1 deletions

View File

@@ -48,6 +48,7 @@
#include <texteditor/icodestylepreferences.h>
#include <texteditor/tabsettings.h>
#include <utils/fancylineedit.h>
#include <utils/qtcassert.h>
#include <utils/macroexpander.h>
@@ -125,6 +126,10 @@ bool TextEditorPlugin::initialize(const QStringList &arguments, QString *errorMe
if (BaseTextEditor *editor = BaseTextEditor::currentTextEditor())
editor->editorWidget()->invokeAssist(Completion);
});
connect(command, &Command::keySequenceChanged, [command] {
Utils::FancyLineEdit::setCompletionShortcut(command->keySequence());
});
Utils::FancyLineEdit::setCompletionShortcut(command->keySequence());
// Add shortcut for invoking quick fix options
QAction *quickFixAction = new QAction(tr("Trigger Refactoring Action"), this);