Crash. Forgot check event type.
--HG-- branch : develop
This commit is contained in:
parent
586b541aec
commit
4fe796f508
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user