mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
facf6e4b59
commit
274f2bf124
1 changed files with 6 additions and 0 deletions
|
@ -314,6 +314,12 @@ bool DateWidget::eventFilter(QObject *object, QEvent *event)
|
||||||
calendarWidget->hide();
|
calendarWidget->hide();
|
||||||
return true;
|
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);
|
return QObject::eventFilter(object, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue