summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/locationinformation.cpp8
-rw-r--r--qt-ui/locationinformation.h1
2 files changed, 7 insertions, 2 deletions
diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp
index f8a125732..111257dfc 100644
--- a/qt-ui/locationinformation.cpp
+++ b/qt-ui/locationinformation.cpp
@@ -432,13 +432,12 @@ DiveLocationLineEdit::DiveLocationLineEdit(QWidget *parent)
view->setFocusProxy(location_line_edit);
connect(this, &QLineEdit::textEdited, this, &DiveLocationLineEdit::setTemporaryDiveSiteName);
+ connect(view, &QAbstractItemView::activated, this, &DiveLocationLineEdit::itemActivated);
}
bool DiveLocationLineEdit::eventFilter(QObject *o, QEvent *e)
{
if(e->type() == QEvent::KeyPress) {
- if (view->focusProxy() == this) qDebug() << "Ueh...";
- else qDebug() << "Nao eh...";
QKeyEvent *keyEv = (QKeyEvent*) e;
qDebug() << view->focusProxy()->objectName();
@@ -466,6 +465,11 @@ bool DiveLocationLineEdit::eventFilter(QObject *o, QEvent *e)
return false;
}
+void DiveLocationLineEdit::itemActivated(const QModelIndex& index)
+{
+ qDebug() << "Activated" << index.data();
+}
+
void DiveLocationLineEdit::refreshDiveSiteCache()
{
model->resetModel();
diff --git a/qt-ui/locationinformation.h b/qt-ui/locationinformation.h
index a1649d645..b52c03a9a 100644
--- a/qt-ui/locationinformation.h
+++ b/qt-ui/locationinformation.h
@@ -94,6 +94,7 @@ public:
void refreshDiveSiteCache();
void setTemporaryDiveSiteName(const QString& s);
bool eventFilter(QObject*, QEvent*);
+ void itemActivated(const QModelIndex& index);
protected:
void keyPressEvent(QKeyEvent *ev);
void showPopup();