From 4fe796f508109da1e11ef24f602f81b938c99c88 Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 24 Dec 2014 14:11:47 +0200 Subject: [PATCH] Crash. Forgot check event type. --HG-- branch : develop --- src/app/dialogs/tools/dialogtool.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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