mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Add a "sort role" for sorting the dive list
By default, sorting is done by the display role, but then we end up sorting by the string we display, which is almost always the wrong thing. So this adds a new "SORT_ROLE" that is used for sorting, and then the data lookup can return the raw data we want to sort by. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									8df20f4149
								
							
						
					
					
						commit
						bb77f5a44e
					
				
					 3 changed files with 29 additions and 1 deletions
				
			
		|  | @ -21,6 +21,7 @@ DiveListView::DiveListView(QWidget *parent) : QTreeView(parent), mouseClickSelec | |||
| 	setUniformRowHeights(true); | ||||
| 	setItemDelegateForColumn(TreeItemDT::RATING, new StarWidgetsDelegate()); | ||||
| 	QSortFilterProxyModel *model = new QSortFilterProxyModel(this); | ||||
| 	model->setSortRole(TreeItemDT::SORT_ROLE); | ||||
| 	setModel(model); | ||||
| 	setSortingEnabled(false); | ||||
| 	header()->setContextMenuPolicy(Qt::ActionsContextMenu); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue