mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
33a19328d8
commit
4352412731
1 changed files with 10 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue