mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 21:12:48 +01:00
PR #7772 is not enough to fix the issue with QCompleter, use event filter instead of connect
This commit is contained in:
parent
950be19727
commit
16698cb77e
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user