summaryrefslogtreecommitdiffstats
path: root/qt-ui/locationinformation.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-09-22 16:27:07 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-09-23 14:15:23 -0700
commit43524127314d1fd6526dc5c23f1c42984b4d5c1b (patch)
tree678aea5c8eed9bd0120a7e668ee802697354aa27 /qt-ui/locationinformation.cpp
parent33a19328d8a34cc97f39f3726c9f1532742500e1 (diff)
downloadsubsurface-43524127314d1fd6526dc5c23f1c42984b4d5c1b.tar.gz
Correctly handle space and tab
Space and tab should select the item in the itemview and hide it; enter and return also do that automatically. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/locationinformation.cpp')
-rw-r--r--qt-ui/locationinformation.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp
index 822184473..c446cada7 100644
--- a/qt-ui/locationinformation.cpp
+++ b/qt-ui/locationinformation.cpp
@@ -449,10 +449,18 @@ bool DiveLocationLineEdit::eventFilter(QObject *o, QEvent *e)
return true;
}
- if(keyEv->key() == Qt::Key_Return || keyEv->key() == Qt::Key_Enter) {
+ if(keyEv->key() == Qt::Key_Return ||
+ keyEv->key() == Qt::Key_Enter) {
view->hide();
return false;
}
+
+ if (keyEv->key() == Qt::Key_Space ||
+ keyEv->key() == Qt::Key_Tab){
+ itemActivated(view->currentIndex());
+ view->hide();
+ return false;
+ }
event(e);
} else if(e->type() == QEvent::MouseButtonPress ) {
if (!view->underMouse()) {
@@ -560,6 +568,7 @@ void DiveLocationLineEdit::showPopup()
view->setGeometry(pos.x(), pos.y(), w, h);
if (!view->isVisible()) {
+ setTemporaryDiveSiteName(text());
proxy->invalidate();
view->show();
}