aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/locationinformation.cpp2
-rw-r--r--qt-ui/locationinformation.h2
-rw-r--r--qt-ui/maintab.cpp3
3 files changed, 7 insertions, 0 deletions
diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp
index bbb4449fc..77f51abde 100644
--- a/qt-ui/locationinformation.cpp
+++ b/qt-ui/locationinformation.cpp
@@ -380,9 +380,11 @@ DiveLocationLineEdit::DiveLocationLineEdit(QWidget *parent) : QLineEdit(parent),
view->installEventFilter(this);
view->setFocusPolicy(Qt::NoFocus);
view->setFocusProxy(this);
+ view->setMouseTracking(true);
connect(this, &QLineEdit::textEdited, this, &DiveLocationLineEdit::setTemporaryDiveSiteName);
connect(view, &QAbstractItemView::activated, this, &DiveLocationLineEdit::itemActivated);
+ connect(view, &QAbstractItemView::entered, this, &DiveLocationLineEdit::entered);
}
bool DiveLocationLineEdit::eventFilter(QObject *o, QEvent *e)
diff --git a/qt-ui/locationinformation.h b/qt-ui/locationinformation.h
index 3e8adeae2..2193b8cdf 100644
--- a/qt-ui/locationinformation.h
+++ b/qt-ui/locationinformation.h
@@ -86,8 +86,10 @@ public:
DiveSiteType currDiveSiteType() const;
uint32_t currDiveSiteUuid() const;
void fixPopupPosition();
+
signals:
void diveSiteSelected(uint32_t uuid);
+ void entered(const QModelIndex& index);
protected:
void keyPressEvent(QKeyEvent *ev);
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index b84b27c67..ba345d938 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -56,6 +56,9 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
closeMessage();
connect(ui.editDiveSiteButton, SIGNAL(clicked()), MainWindow::instance(), SIGNAL(startDiveSiteEdit()));
+#ifndef NO_MARBLE
+ connect(ui.location, &DiveLocationLineEdit::entered, GlobeGPS::instance(), &GlobeGPS::centerOnIndex);
+#endif
QAction *action = new QAction(tr("Apply changes"), this);
connect(action, SIGNAL(triggered(bool)), this, SLOT(acceptChanges()));