diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2022-04-09 02:21:05 +0200 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2022-04-13 20:55:01 +0200 |
commit | 3ec6504a2e5b4afb7a2719a82191e0b96fe23214 (patch) | |
tree | cf49b5dc68cb8606df4c803095c0b6c61c39356b /src | |
parent | e0680bbce8b89ad5de9d1b9f818b76df68d72696 (diff) | |
download | bitcoin-3ec6504a2e5b4afb7a2719a82191e0b96fe23214.tar.xz |
qt: Do not use `QKeyEvent` copy constructor
This change is preparation for Qt 6, and it fixes an experimental build
with Qt 6.2.4 as copying of `QEvent` has been disabled in Qt 6.0.0 (see
19f9b0d5f54379151eb71e98555b203ad6756276 upstream commit).
Diffstat (limited to 'src')
-rw-r--r-- | src/qt/rpcconsole.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index dcc4f36aaa..881255c638 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -618,17 +618,16 @@ bool RPCConsole::eventFilter(QObject* obj, QEvent *event) case Qt::Key_Down: if(obj == ui->lineEdit) { browseHistory(1); return true; } break; case Qt::Key_PageUp: /* pass paging keys to messages widget */ case Qt::Key_PageDown: - if(obj == ui->lineEdit) - { - QApplication::postEvent(ui->messagesWidget, new QKeyEvent(*keyevt)); + if (obj == ui->lineEdit) { + QApplication::sendEvent(ui->messagesWidget, keyevt); 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)); + if (obj == autoCompleter->popup()) { + QApplication::sendEvent(ui->lineEdit, keyevt); autoCompleter->popup()->hide(); return true; } @@ -642,7 +641,7 @@ bool RPCConsole::eventFilter(QObject* obj, QEvent *event) ((mod & Qt::ShiftModifier) && key == Qt::Key_Insert))) { ui->lineEdit->setFocus(); - QApplication::postEvent(ui->lineEdit, new QKeyEvent(*keyevt)); + QApplication::sendEvent(ui->lineEdit, keyevt); return true; } } |