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);
if (plainTextEdit != nullptr)
{
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(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<QKeyEvent *>(event);
if ((keyEvent->key() == Qt::Key_Enter) || (keyEvent->key() == Qt::Key_Return))
{
// Ignore Enter key
return true;
}
}
}
else