Show the correct delegate on the completer

For some reason the completer wouldn't show the delegate if the line order
of the code was different.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2015-07-08 09:59:25 -03:00 committed by Dirk Hohndel
parent ff6bf497c8
commit eff22c28db

View file

@ -59,21 +59,13 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
closeMessage();
QCompleter *completer = new QCompleter();
QListView *completerListview = new QListView();
completer->setPopup(completerListview);
completer->setModel(LocationInformationModel::instance());
completer->setCompletionColumn(LocationInformationModel::NAME);
completer->setCompletionRole(Qt::DisplayRole);
completer->setCompletionMode(QCompleter::PopupCompletion);
completer->setCaseSensitivity(Qt::CaseInsensitive);
QListView *completerListview = new QListView();
completerListview->setItemDelegate(new LocationFilterDelegate());
completer->setPopup(completerListview);
QListView *completerListView2 = new QListView();
completerListView2->setItemDelegate(new LocationFilterDelegate());
completerListView2->setModel(LocationInformationModel::instance());
completerListView2->setModelColumn(1);
completerListView2->show();
ui.location->setCompleter(completer);
connect(ui.addDiveSite, SIGNAL(clicked()), this, SLOT(showDiveSiteSimpleEdit()));