diff options
| author | Jonas Schnelli <[email protected]> | 2016-06-02 11:11:23 +0200 |
|---|---|---|
| committer | Jonas Schnelli <[email protected]> | 2016-06-02 11:11:38 +0200 |
| commit | ee1533e262e72d0b5aaae187ab9a37ba79c9cda7 (patch) | |
| tree | 5d8e26cd5d5ff1b4d93adb3861959b5c1ee523d4 | |
| parent | Merge #8029: [Doc] Simplify OS X build notes (diff) | |
| parent | PR #7772 is not enough to fix the issue with QCompleter, use event filter ins... (diff) | |
| download | discoin-ee1533e262e72d0b5aaae187ab9a37ba79c9cda7.tar.xz discoin-ee1533e262e72d0b5aaae187ab9a37ba79c9cda7.zip | |
Merge #8129: Fix RPC console auto completer
16698cb PR #7772 is not enough to fix the issue with QCompleter, use event filter instead of `connect` (UdjinM6)
| -rw-r--r-- | src/qt/rpcconsole.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index b11648e46..11f3e49a0 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -327,6 +327,14 @@ bool RPCConsole::eventFilter(QObject* obj, QEvent *event) return true; } break; + case Qt::Key_Return: + case Qt::Key_Enter: + // forward these events to lineEdit + if(obj == autoCompleter->popup()) { + QApplication::postEvent(ui->lineEdit, new QKeyEvent(*keyevt)); + return true; + } + break; default: // Typing in messages widget brings focus to line edit, and redirects key there // Exclude most combinations and keys that emit no text, except paste shortcuts @@ -458,9 +466,7 @@ void RPCConsole::setClientModel(ClientModel *model) autoCompleter = new QCompleter(wordList, this); ui->lineEdit->setCompleter(autoCompleter); - - // clear the lineEdit after activating from QCompleter - connect(autoCompleter, SIGNAL(activated(const QString&)), ui->lineEdit, SLOT(clear()), Qt::QueuedConnection); + autoCompleter->popup()->installEventFilter(this); } } |