Crash. Forgot check event type.

--HG--
branch : develop
This commit is contained in:
dismine 2014-12-24 14:11:47 +02:00
parent 586b541aec
commit 4fe796f508

View File

@ -410,11 +410,14 @@ bool DialogTool::eventFilter(QObject *object, QEvent *event)
QPlainTextEdit *plainTextEdit = qobject_cast<QPlainTextEdit *>(object); QPlainTextEdit *plainTextEdit = qobject_cast<QPlainTextEdit *>(object);
if (plainTextEdit != nullptr) if (plainTextEdit != nullptr)
{ {
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event); if (event->type() == QEvent::KeyPress)
if ((keyEvent->key() == Qt::Key_Enter) || (keyEvent->key() == Qt::Key_Return))
{ {
// Ignore Enter key QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
return true; if ((keyEvent->key() == Qt::Key_Enter) || (keyEvent->key() == Qt::Key_Return))
{
// Ignore Enter key
return true;
}
} }
} }
else else