diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index f2f40b050..2a0c7ae72 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -410,11 +410,14 @@ bool DialogTool::eventFilter(QObject *object, QEvent *event) QPlainTextEdit *plainTextEdit = qobject_cast(object); if (plainTextEdit != nullptr) { - QKeyEvent *keyEvent = static_cast(event); - if ((keyEvent->key() == Qt::Key_Enter) || (keyEvent->key() == Qt::Key_Return)) + if (event->type() == QEvent::KeyPress) { - // Ignore Enter key - return true; + QKeyEvent *keyEvent = static_cast(event); + if ((keyEvent->key() == Qt::Key_Enter) || (keyEvent->key() == Qt::Key_Return)) + { + // Ignore Enter key + return true; + } } } else