diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2015-07-08 09:59:25 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-07-08 07:49:29 -0700 |
commit | eff22c28db77594e84f306dc58fa4456d0563009 (patch) | |
tree | 837628d880d65ae53997725cbd6db2fb1eeabc1a /qt-ui | |
parent | ff6bf497c8ae8ee713f9f55da07f7d45bcf9fb20 (diff) | |
download | subsurface-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.cpp | 12 |
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())); |