mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 06:30:26 +00:00
34 lines
652 B
C++
34 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;
|
||
|
}
|