mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-21 14:34:49 +01:00
Merge bitcoin-core/gui#580: Getting ready to Qt 6 (3/n). Do not use QKeyEvent
copy constructor
3ec6504a2e
qt: Do not use `QKeyEvent` copy constructor (Hennadii Stepanov) Pull request description: This PR is preparation for [Qt 6](https://github.com/bitcoin/bitcoin/pull/24798), and it fixes an experimental build with Qt 6.2.4 as copying of `QEvent` has been [disabled](19f9b0d5f5
) in Qt 6.0.0. ACKs for top commit: w0xlt: tACK3ec6504a2e
on Ubuntu 21.10, Qt 5.15.2 shaavan: reACK3ec6504a2e
Tree-SHA512: 583a9dad0c621d9f02f77ccaa9f55ee79e12e3c47f418911ef2dfe0de357d772d1928ae3ec19b6f0c0674da858bab9d4542a26cc14b06ed921370dfeabd1c194
This commit is contained in:
commit
37e49cc1b5
1 changed files with 5 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue