diff options
Diffstat (limited to 'qt-models/cleanertablemodel.cpp')
-rw-r--r-- | qt-models/cleanertablemodel.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/qt-models/cleanertablemodel.cpp b/qt-models/cleanertablemodel.cpp new file mode 100644 index 000000000..d2405d42f --- /dev/null +++ b/qt-models/cleanertablemodel.cpp @@ -0,0 +1,33 @@ +#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; +} |