mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Fix weight adding in the Qt UI & fix the header height for tables
Fixes #203 Signed-off-by: Patrick Valsecchi <patrick@thus.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									1524b1a0ae
								
							
						
					
					
						commit
						f02b5e5d90
					
				
					 3 changed files with 5 additions and 4 deletions
				
			
		|  | @ -34,6 +34,8 @@ DiveListView::DiveListView(QWidget *parent) : QTreeView(parent), mouseClickSelec | ||||||
| 	setSortingEnabled(false); | 	setSortingEnabled(false); | ||||||
| 	setContextMenuPolicy(Qt::DefaultContextMenu); | 	setContextMenuPolicy(Qt::DefaultContextMenu); | ||||||
| 	header()->setContextMenuPolicy(Qt::ActionsContextMenu); | 	header()->setContextMenuPolicy(Qt::ActionsContextMenu); | ||||||
|  | 	const QFontMetrics metrics(defaultModelFont()); | ||||||
|  | 	header()->setMinimumHeight(metrics.height() + 10); | ||||||
| 	QAction *showSearchBox = new QAction(tr("Show Search Box"), this); | 	QAction *showSearchBox = new QAction(tr("Show Search Box"), this); | ||||||
| 	showSearchBox->setShortcut( Qt::CTRL + Qt::Key_F); | 	showSearchBox->setShortcut( Qt::CTRL + Qt::Key_F); | ||||||
| 	showSearchBox->setShortcutContext(Qt::ApplicationShortcut); | 	showSearchBox->setShortcutContext(Qt::ApplicationShortcut); | ||||||
|  |  | ||||||
|  | @ -461,8 +461,8 @@ void MainTab::acceptChanges() | ||||||
| 		if (weightModel->changed) { | 		if (weightModel->changed) { | ||||||
| 			mark_divelist_changed(TRUE); | 			mark_divelist_changed(TRUE); | ||||||
| 			Q_FOREACH (dive *d, notesBackup.keys()) { | 			Q_FOREACH (dive *d, notesBackup.keys()) { | ||||||
| 				for (int i = 0; i < MAX_CYLINDERS; i++) { | 				for (int i = 0; i < MAX_WEIGHTSYSTEMS; i++) { | ||||||
| 					d->cylinder[i] = multiEditEquipmentPlaceholder.cylinder[i]; | 					d->weightsystem[i] = multiEditEquipmentPlaceholder.weightsystem[i]; | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|  | @ -64,9 +64,8 @@ void TableView::setModel(QAbstractItemModel *model){ | ||||||
| 	} | 	} | ||||||
| 	s.endGroup(); | 	s.endGroup(); | ||||||
| 
 | 
 | ||||||
| 	ui->tableView->horizontalHeader()->setResizeMode(0, QHeaderView::Fixed); |  | ||||||
| 	QFontMetrics metrics(defaultModelFont()); | 	QFontMetrics metrics(defaultModelFont()); | ||||||
| 	ui->tableView->verticalHeader()->setDefaultSectionSize( metrics.height() + 8 ); | 	ui->tableView->horizontalHeader()->setMinimumHeight(metrics.height() + 10); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void TableView::fixPlusPosition() | void TableView::fixPlusPosition() | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue