1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-22 10:53:54 +00:00
openmw/apps/opencs/model/tools/reportmodel.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

68 lines
1.5 KiB
C++
Raw Normal View History

2012-12-11 14:35:47 +00:00
#ifndef CSM_TOOLS_REPORTMODEL_H
#define CSM_TOOLS_REPORTMODEL_H
#include <string>
#include <vector>
#include <QAbstractTableModel>
2022-10-19 17:02:00 +00:00
#include <QModelIndex>
#include <QVariant>
2012-12-11 14:35:47 +00:00
#include "../doc/messages.hpp"
2022-10-19 17:02:00 +00:00
namespace CSMWorld
{
class UniversalId;
}
2012-12-11 14:35:47 +00:00
namespace CSMTools
{
class ReportModel : public QAbstractTableModel
{
Q_OBJECT
2022-09-22 18:26:05 +00:00
std::vector<CSMDoc::Message> mRows;
2022-09-22 18:26:05 +00:00
2015-03-29 13:28:31 +00:00
// Fixed columns
2015-03-29 11:55:31 +00:00
enum Columns
2022-09-22 18:26:05 +00:00
{
2015-03-29 13:28:31 +00:00
Column_Type = 0,
Column_Id = 1,
Column_Hint = 2
2022-09-22 18:26:05 +00:00
};
2012-12-11 14:35:47 +00:00
2015-03-29 13:28:31 +00:00
// Configurable columns
int mColumnDescription;
2015-03-29 13:28:31 +00:00
int mColumnField;
int mColumnSeverity;
2012-12-11 14:35:47 +00:00
2022-09-22 18:26:05 +00:00
public:
2015-03-29 13:28:31 +00:00
ReportModel(bool fieldColumn = false, bool severityColumn = true);
2015-03-29 11:55:31 +00:00
2015-03-29 13:28:31 +00:00
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
2012-12-11 14:35:47 +00:00
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
2012-12-11 14:35:47 +00:00
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
2012-12-11 14:35:47 +00:00
bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex()) override;
2012-12-11 14:35:47 +00:00
void add(const CSMDoc::Message& message);
2012-12-11 14:35:47 +00:00
void flagAsReplaced(int index);
const CSMWorld::UniversalId& getUniversalId(int row) const;
std::string getHint(int row) const;
void clear();
// Return number of messages with Error or SeriousError severity.
int countErrors() const;
2012-12-11 14:35:47 +00:00
};
}
#endif