diff options
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/simplewidgets.cpp | 15 | ||||
-rw-r--r-- | qt-ui/simplewidgets.h | 1 |
2 files changed, 15 insertions, 1 deletions
diff --git a/qt-ui/simplewidgets.cpp b/qt-ui/simplewidgets.cpp index fe9b8f592..eff3f668b 100644 --- a/qt-ui/simplewidgets.cpp +++ b/qt-ui/simplewidgets.cpp @@ -374,4 +374,17 @@ void DateWidget::focusInEvent(QFocusEvent *event) void DateWidget::focusOutEvent(QFocusEvent *event) { QWidget::focusOutEvent(event); -}
\ No newline at end of file +} + +void DateWidget::keyPressEvent(QKeyEvent *event) +{ + if ( event->key() == Qt::Key_Return || + event->key() == Qt::Key_Enter || + event->key() == Qt::Key_Space){ + calendarWidget->move(mapToGlobal(QPoint(0,64))); + calendarWidget->show(); + event->setAccepted(true); + }else{ + QWidget::keyPressEvent(event); + } +} diff --git a/qt-ui/simplewidgets.h b/qt-ui/simplewidgets.h index 445dfebd4..6587c2739 100644 --- a/qt-ui/simplewidgets.h +++ b/qt-ui/simplewidgets.h @@ -102,6 +102,7 @@ protected: void mousePressEvent(QMouseEvent *event); void focusInEvent(QFocusEvent *); void focusOutEvent(QFocusEvent *); + void keyPressEvent(QKeyEvent *); signals: void dateChanged(const QDate& date); private: |