summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-07-08 09:59:25 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-08 07:49:29 -0700
commiteff22c28db77594e84f306dc58fa4456d0563009 (patch)
tree837628d880d65ae53997725cbd6db2fb1eeabc1a /qt-ui
parentff6bf497c8ae8ee713f9f55da07f7d45bcf9fb20 (diff)
downloadsubsurface-eff22c28db77594e84f306dc58fa4456d0563009.tar.gz
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>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/maintab.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index f698dbb36..0ff44ae0c 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -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()));