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 <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-06-30 18:28:13 -03:00 committed by Dirk Hohndel
parent facf6e4b59
commit 274f2bf124

View file

@ -314,6 +314,12 @@ bool DateWidget::eventFilter(QObject *object, QEvent *event)
calendarWidget->hide();
return true;
}
if(event->type() == QEvent::KeyPress){
QKeyEvent *ev = static_cast<QKeyEvent*>(event);
if(ev->key() == Qt::Key_Escape){
calendarWidget->hide();
}
}
return QObject::eventFilter(object, event);
}