refactor: MainWindow::EvenFilter set keyEvent in if only
This commit is contained in:
parent
a9bfcf3c81
commit
814d63af28
1 changed files with 1 additions and 2 deletions
|
|
@ -961,8 +961,7 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *event)
|
|||
{
|
||||
if (obj != ui->lineEditName || event->type() != QEvent::KeyPress)
|
||||
return false;
|
||||
const auto keyEvent = static_cast<QKeyEvent *>(event);
|
||||
if (keyEvent->key() != Qt::Key_Escape)
|
||||
if (const auto keyEvent = static_cast<QKeyEvent *>(event); keyEvent->key() != Qt::Key_Escape)
|
||||
return false;
|
||||
ui->lineEditName->hide();
|
||||
ui->lblComputerName->show();
|
||||
|
|
|
|||
Loading…
Reference in a new issue