Fix correct size of the popup

Correct the popup visibility.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2015-09-21 17:22:31 -03:00 committed by Dirk Hohndel
parent 317c3de91d
commit dd21ab6b11

View file

@ -508,16 +508,14 @@ void DiveLocationLineEdit::setTemporaryDiveSiteName(const QString& s)
void DiveLocationLineEdit::keyPressEvent(QKeyEvent *ev)
{
qDebug() << "Pressing key" << ev->key();
QLineEdit::keyPressEvent(ev);
if(ev->key() != Qt::Key_Left &&
ev->key() != Qt::Key_Right &&
ev->key() != Qt::Key_Escape &&
ev->key() != Qt::Key_Return &&
!view->isVisible()) {
ev->key() != Qt::Key_Return ) {
showPopup();
} else if (ev->key() == Qt::Key_Escape) {
view->hide();
} else {
QLineEdit::keyPressEvent(ev);
}
}