mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Dive site rewrite: use a QCompleter to show the list of dive sites
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									8bd9fb161a
								
							
						
					
					
						commit
						e28af7c639
					
				
					 1 changed files with 8 additions and 1 deletions
				
			
		|  | @ -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); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue