From 274f2bf124cb1d8c2bcb4ad3476813dae26b266b Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 30 Jun 2014 18:28:13 -0300 Subject: Added a shortcut 'ESC' to close the calendar widget This hides the calendar widget when the user press esc when it's running. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/simplewidgets.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qt-ui/simplewidgets.cpp b/qt-ui/simplewidgets.cpp index 7da691d1b..b11d7528a 100644 --- a/qt-ui/simplewidgets.cpp +++ b/qt-ui/simplewidgets.cpp @@ -314,6 +314,12 @@ bool DateWidget::eventFilter(QObject *object, QEvent *event) calendarWidget->hide(); return true; } + if(event->type() == QEvent::KeyPress){ + QKeyEvent *ev = static_cast(event); + if(ev->key() == Qt::Key_Escape){ + calendarWidget->hide(); + } + } return QObject::eventFilter(object, event); } -- cgit v1.2.3-70-g09d2