summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/maintab.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index adc60aec0..99459dbd3 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -99,7 +99,11 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
connect(ui.cylinders->view(), SIGNAL(clicked(QModelIndex)), this, SLOT(editCylinderWidget(QModelIndex)));
connect(ui.weights->view(), SIGNAL(clicked(QModelIndex)), this, SLOT(editWeightWidget(QModelIndex)));
- ui.location->setCompleter(new QCompleter(LocationInformationModel::instance()));
+ LocationCompletionModel *locationCompletion = new LocationCompletionModel();
+ ui.location->setCompleter(new QCompleter(locationCompletion));
+ ui.location->completer()->setCaseSensitivity(Qt::CaseInsensitive);
+ ui.location->completer()->setCompletionMode(QCompleter::PopupCompletion);
+
ui.cylinders->view()->setItemDelegateForColumn(CylindersModel::TYPE, new TankInfoDelegate(this));
ui.cylinders->view()->setItemDelegateForColumn(CylindersModel::USE, new TankUseDelegate(this));
ui.weights->view()->setItemDelegateForColumn(WeightModel::TYPE, new WSInfoDelegate(this));
@@ -455,6 +459,9 @@ void MainTab::updateDiveInfo(bool clear)
struct dive *prevd;
char buf[1024];
+ LocationCompletionModel *m = qobject_cast<LocationCompletionModel*>(ui.location->completer()->model());
+ m->updateModel();
+
process_selected_dives();
process_all_dives(&displayed_dive, &prevd);