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

@ -409,6 +409,8 @@ 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)
{
if (event->type() == QEvent::KeyPress)
{ {
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event); QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
if ((keyEvent->key() == Qt::Key_Enter) || (keyEvent->key() == Qt::Key_Return)) if ((keyEvent->key() == Qt::Key_Enter) || (keyEvent->key() == Qt::Key_Return))
@ -417,6 +419,7 @@ bool DialogTool::eventFilter(QObject *object, QEvent *event)
return true; return true;
} }
} }
}
else else
{ {
// pass the event on to the parent class // pass the event on to the parent class