summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--desktop-widgets/locationinformation.cpp7
-rw-r--r--desktop-widgets/locationinformation.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/desktop-widgets/locationinformation.cpp b/desktop-widgets/locationinformation.cpp
index 3c09656f1..1a80486a3 100644
--- a/desktop-widgets/locationinformation.cpp
+++ b/desktop-widgets/locationinformation.cpp
@@ -41,6 +41,13 @@ LocationInformationWidget::LocationInformationWidget(QWidget *parent) : QGroupBo
ui.diveSiteListView->installEventFilter(this);
}
+void LocationInformationWidget::keyPressEvent(QKeyEvent *e)
+{
+ if (e->key() == Qt::Key_Escape)
+ MainWindow::instance()->setFocus();
+ return QGroupBox::keyPressEvent(e);
+}
+
bool LocationInformationWidget::eventFilter(QObject *object, QEvent *ev)
{
if (ev->type() == QEvent::ContextMenu) {
diff --git a/desktop-widgets/locationinformation.h b/desktop-widgets/locationinformation.h
index 161ce26ef..beb5fd404 100644
--- a/desktop-widgets/locationinformation.h
+++ b/desktop-widgets/locationinformation.h
@@ -33,6 +33,7 @@ private slots:
void updateLabels();
void diveSiteChanged(struct dive_site *ds, int field);
private:
+ void keyPressEvent(QKeyEvent *e) override;
void clearLabels();
Ui::LocationInformation ui;
GPSLocationInformationModel filter_model;