summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-07-01 19:31:35 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-01 19:23:01 -0700
commit1b8f7f53f2a715b7e0faaf404985165b608b840a (patch)
treecaed4ceb90248c2ca9f1fc80db7d9e5a1a3b8b65 /qt-ui
parent43bb8881fdbd4e37600047062a9402a81cefe7d8 (diff)
downloadsubsurface-1b8f7f53f2a715b7e0faaf404985165b608b840a.tar.gz
Added again a QCompleter to show the possibilities
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/maintab.cpp8
-rw-r--r--qt-ui/maintab.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 1236c949d..fe1143f39 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -58,6 +58,13 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
ui.extraData->setModel(extraDataModel);
closeMessage();
+ QCompleter *completer = new QCompleter();
+ completer->setModel(LocationInformationModel::instance());
+ completer->setCompletionColumn(LocationInformationModel::NAME);
+ completer->setCompletionRole(Qt::DisplayRole);
+ completer->setCompletionMode(QCompleter::PopupCompletion);
+
+ ui.location->setCompleter(completer);
connect(ui.addDiveSite, SIGNAL(clicked()), this, SLOT(showDiveSiteSimpleEdit()));
QAction *action = new QAction(tr("Apply changes"), this);
@@ -746,6 +753,7 @@ void MainTab::reload()
buddyModel.updateModel();
diveMasterModel.updateModel();
tagModel.updateModel();
+ LocationInformationModel::instance()->update();
}
// tricky little macro to edit all the selected dives
diff --git a/qt-ui/maintab.h b/qt-ui/maintab.h
index a8f2dfab4..c96acb28a 100644
--- a/qt-ui/maintab.h
+++ b/qt-ui/maintab.h
@@ -14,6 +14,7 @@
#include "ui_maintab.h"
#include "completionmodels.h"
+#include "divelocationmodel.h"
#include "dive.h"
class WeightModel;