Fixing VKB QDateEdit <Enter> does not work!

This commit is contained in:
xueyan hu
2022-03-15 13:06:50 +08:00
parent 8011ac9df8
commit fc1be95066

View File

@@ -7,7 +7,7 @@
#include <QComboBox>
#include <QDateEdit>
#include <QtVirtualKeyboard>
#include <QKeyEvent>
#include <QLineEdit>
#include <QAbstractSpinBox>
@@ -91,6 +91,14 @@ bool InputObject::eventFilter(QObject* obj, QEvent* event)
//qDebug() << "touchScreen()";
}
if (event->type() == QEvent::KeyPress) {
QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
if (keyEvent->key() == Qt::Key_Return && curDateEdit)
{
this->HidePanel();
this->hide();
}
}
//mouse button release means setfocus is useless
if (event->type() == QEvent::MouseButtonRelease)
{