Added again a QCompleter to show the possibilities

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2015-07-01 19:31:35 -03:00 committed by Dirk Hohndel
parent 43bb8881fd
commit 1b8f7f53f2
2 changed files with 9 additions and 0 deletions

View file

@ -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

View file

@ -14,6 +14,7 @@
#include "ui_maintab.h"
#include "completionmodels.h"
#include "divelocationmodel.h"
#include "dive.h"
class WeightModel;