mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Dive d/l selection UI: show reasonable column headers
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									1ce2d42e8d
								
							
						
					
					
						commit
						d143527732
					
				
					 2 changed files with 18 additions and 0 deletions
				
			
		|  | @ -522,6 +522,23 @@ int DiveImportedModel::rowCount(const QModelIndex &model) const | |||
| 	return lastIndex - firstIndex; | ||||
| } | ||||
| 
 | ||||
| QVariant DiveImportedModel::headerData(int section, Qt::Orientation orientation, int role) const | ||||
| { | ||||
| 	if (orientation == Qt::Vertical) | ||||
| 		return QVariant(); | ||||
| 	if (role == Qt::DisplayRole) { | ||||
| 		switch (section) { | ||||
| 		case 0: | ||||
| 			return QVariant(tr("Date/time")); | ||||
| 		case 1: | ||||
| 			return QVariant(tr("Duration")); | ||||
| 		case 2: | ||||
| 			return QVariant(tr("Depth")); | ||||
| 		} | ||||
| 	} | ||||
| 	return QVariant(); | ||||
| } | ||||
| 
 | ||||
| QVariant DiveImportedModel::data(const QModelIndex &index, int role) const | ||||
| { | ||||
| 	if (!index.isValid()) | ||||
|  |  | |||
|  | @ -33,6 +33,7 @@ public: | |||
| 	int columnCount(const QModelIndex& index = QModelIndex()) const; | ||||
| 	int rowCount(const QModelIndex& index = QModelIndex()) const; | ||||
| 	QVariant data(const QModelIndex& index, int role) const; | ||||
| 	QVariant headerData(int section, Qt::Orientation orientation, int role) const; | ||||
| 	bool setData(const QModelIndex &index, const QVariant &value, int role); | ||||
| 	void setImportedDivesIndexes(int first, int last); | ||||
| 	Qt::ItemFlags flags(const QModelIndex &index) const; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue