diff options
author | UdjinM6 <UdjinM6@dash.org> | 2016-05-31 05:30:35 +0300 |
---|---|---|
committer | UdjinM6 <UdjinM6@dash.org> | 2016-05-31 06:33:34 +0300 |
commit | 16698cb77e455ae1e2fffd8d0225d2486232a366 (patch) | |
tree | 715f102328765c549de29b99a6f8c66a10c5fead /src/qt/rpcconsole.cpp | |
parent | 950be19727a581970591d8f8138dfe4725750382 (diff) |
PR #7772 is not enough to fix the issue with QCompleter, use event filter instead of `connect`
Diffstat (limited to 'src/qt/rpcconsole.cpp')
-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 b11648e46f..11f3e49a06 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); } } |