mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	models.h / .cpp was getting too big (around 2.5k lines), and each change triggered a rebuild in tons of parts of Subsurface, this is the first commit trying to make the models code sane by removing them all of the models.h/cpp file and also clearning code in the process. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
		
			
				
	
	
		
			33 lines
		
	
	
	
		
			652 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
	
		
			652 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #include "cleanertablemodel.h"
 | |
| #include "metrics.h"
 | |
| 
 | |
| CleanerTableModel::CleanerTableModel(QObject *parent) : QAbstractTableModel(parent)
 | |
| {
 | |
| }
 | |
| 
 | |
| int CleanerTableModel::columnCount(const QModelIndex &parent) const
 | |
| {
 | |
| 	return headers.count();
 | |
| }
 | |
| 
 | |
| QVariant CleanerTableModel::headerData(int section, Qt::Orientation orientation, int role) const
 | |
| {
 | |
| 	QVariant ret;
 | |
| 
 | |
| 	if (orientation == Qt::Vertical)
 | |
| 		return ret;
 | |
| 
 | |
| 	switch (role) {
 | |
| 	case Qt::FontRole:
 | |
| 		ret = defaultModelFont();
 | |
| 		break;
 | |
| 	case Qt::DisplayRole:
 | |
| 		ret = headers.at(section);
 | |
| 	}
 | |
| 	return ret;
 | |
| }
 | |
| 
 | |
| void CleanerTableModel::setHeaderDataStrings(const QStringList &newHeaders)
 | |
| {
 | |
| 	headers = newHeaders;
 | |
| }
 |