2017-04-27 18:25:32 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2015-05-28 18:00:58 +00:00
|
|
|
#include "cleanertablemodel.h"
|
2016-04-05 05:02:03 +00:00
|
|
|
#include "core/metrics.h"
|
2015-05-28 18:00:58 +00:00
|
|
|
|
|
|
|
CleanerTableModel::CleanerTableModel(QObject *parent) : QAbstractTableModel(parent)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-05-21 15:53:42 +00:00
|
|
|
int CleanerTableModel::columnCount(const QModelIndex&) const
|
2015-05-28 18:00:58 +00:00
|
|
|
{
|
|
|
|
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;
|
|
|
|
}
|