diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-06-30 18:28:13 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-06-30 16:06:05 -0700 |
commit | 274f2bf124cb1d8c2bcb4ad3476813dae26b266b (patch) | |
tree | 9539fc9aff9fb04adf8d5f6f665013d9231e41de /qt-ui/simplewidgets.cpp | |
parent | facf6e4b595354f916edabd215b327196c111868 (diff) | |
download | subsurface-274f2bf124cb1d8c2bcb4ad3476813dae26b266b.tar.gz |
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>
Diffstat (limited to 'qt-ui/simplewidgets.cpp')
-rw-r--r-- | qt-ui/simplewidgets.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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<QKeyEvent*>(event); + if(ev->key() == Qt::Key_Escape){ + calendarWidget->hide(); + } + } return QObject::eventFilter(object, event); } |