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).
This commit is contained in:
1 file changed
+5
-6
@@ -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_Down: if(obj == ui->lineEdit) { browseHistory(1); return true; } break;
|
||||||
case Qt::Key_PageUp: /* pass paging keys to messages widget */
|
case Qt::Key_PageUp: /* pass paging keys to messages widget */
|
||||||
case Qt::Key_PageDown:
|
case Qt::Key_PageDown:
|
||||||
if(obj == ui->lineEdit)
|
if (obj == ui->lineEdit) {
|
||||||
{
|
QApplication::sendEvent(ui->messagesWidget, keyevt);
|
||||||
QApplication::postEvent(ui->messagesWidget, new QKeyEvent(*keyevt));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Qt::Key_Return:
|
case Qt::Key_Return:
|
||||||
case Qt::Key_Enter:
|
case Qt::Key_Enter:
|
||||||
// forward these events to lineEdit
|
// forward these events to lineEdit
|
||||||
if(obj == autoCompleter->popup()) {
|
if (obj == autoCompleter->popup()) {
|
||||||
QApplication::postEvent(ui->lineEdit, new QKeyEvent(*keyevt));
|
QApplication::sendEvent(ui->lineEdit, keyevt);
|
||||||
autoCompleter->popup()->hide();
|
autoCompleter->popup()->hide();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -642,7 +641,7 @@ bool RPCConsole::eventFilter(QObject* obj, QEvent *event)
|
|||||||
((mod & Qt::ShiftModifier) && key == Qt::Key_Insert)))
|
((mod & Qt::ShiftModifier) && key == Qt::Key_Insert)))
|
||||||
{
|
{
|
||||||
ui->lineEdit->setFocus();
|
ui->lineEdit->setFocus();
|
||||||
QApplication::postEvent(ui->lineEdit, new QKeyEvent(*keyevt));
|
QApplication::sendEvent(ui->lineEdit, keyevt);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user