From d95856d3b272671fe9db008605ea84b27195f46b Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 23 Sep 2015 16:19:58 -0300 Subject: Select an index if no index is selected Defaults to first row. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/locationinformation.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'qt-ui') diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp index 56ef2d7f3..8e08a60be 100644 --- a/qt-ui/locationinformation.cpp +++ b/qt-ui/locationinformation.cpp @@ -522,6 +522,9 @@ void DiveLocationLineEdit::fixPopupPosition() } view->setGeometry(pos.x(), pos.y(), w, h); + if(!view->currentIndex().isValid()) { + view->setCurrentIndex(view->model()->index(0,1)); + } } void DiveLocationLineEdit::showPopup() @@ -530,7 +533,6 @@ void DiveLocationLineEdit::showPopup() if (!view->isVisible()) { setTemporaryDiveSiteName(text()); proxy->invalidate(); - view->setCurrentIndex(view->model()->index(0,1)); view->show(); } } -- cgit v1.2.3-70-g09d2