Skip to content

Commit

Permalink
Yet another fix for rpc autoCompleter, #752 was not enough (#844)
Browse files Browse the repository at this point in the history
  • Loading branch information
UdjinM6 authored and schinzelh committed May 31, 2016
1 parent 11d9330 commit aa98034
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,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
Expand Down Expand Up @@ -473,9 +481,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);
}
}

Expand Down

0 comments on commit aa98034

Please sign in to comment.