OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
reportmodel.hpp
Go to the documentation of this file.
1 #ifndef CSM_TOOLS_REPORTMODEL_H
2 #define CSM_TOOLS_REPORTMODEL_H
3 
4 #include <vector>
5 #include <string>
6 
7 #include <QAbstractTableModel>
8 
9 #include "../doc/messages.hpp"
10 
11 #include "../world/universalid.hpp"
12 
13 namespace CSMTools
14 {
16  {
17  Q_OBJECT
18 
19  std::vector<CSMDoc::Message> mRows;
20 
21  // Fixed columns
22  enum Columns
23  {
25  };
26 
27  // Configurable columns
31 
32  public:
33 
34  ReportModel (bool fieldColumn = false, bool severityColumn = true);
35 
36  virtual int rowCount (const QModelIndex & parent = QModelIndex()) const;
37 
38  virtual int columnCount (const QModelIndex & parent = QModelIndex()) const;
39 
40  virtual QVariant data (const QModelIndex & index, int role = Qt::DisplayRole) const;
41 
42  virtual QVariant headerData (int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
43 
44  virtual bool removeRows (int row, int count, const QModelIndex& parent = QModelIndex());
45 
46  void add (const CSMDoc::Message& message);
47 
48  void flagAsReplaced (int index);
49 
50  const CSMWorld::UniversalId& getUniversalId (int row) const;
51 
52  std::string getHint (int row) const;
53 
54  void clear();
55 
56  // Return number of messages with Error or SeriousError severity.
57  int countErrors() const;
58  };
59 }
60 
61 #endif
Columns
Definition: reportmodel.hpp:22
void message(CodeContainer &code, Literals &literals, const std::string &message, int buttons)
Definition: generator.cpp:537
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const
Definition: reportmodel.cpp:30
virtual QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Definition: reportmodel.cpp:94
void flagAsReplaced(int index)
Definition: reportmodel.cpp:146
Definition: messages.hpp:13
int mColumnField
Definition: reportmodel.hpp:29
Definition: reportmodel.hpp:15
const CSMWorld::UniversalId & getUniversalId(int row) const
Definition: reportmodel.cpp:161
void add(const CSMDoc::Message &message)
Definition: reportmodel.cpp:137
std::vector< CSMDoc::Message > mRows
Definition: reportmodel.hpp:19
Definition: reportmodel.hpp:24
Definition: reportmodel.hpp:24
virtual bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex())
Definition: reportmodel.cpp:120
int mColumnDescription
Definition: reportmodel.hpp:28
int countErrors() const
Definition: reportmodel.cpp:181
std::string getHint(int row) const
Definition: reportmodel.cpp:166
int mColumnSeverity
Definition: reportmodel.hpp:30
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Definition: reportmodel.cpp:38
void clear()
Definition: reportmodel.cpp:171
ReportModel(bool fieldColumn=false, bool severityColumn=true)
Definition: reportmodel.cpp:8
Definition: reportmodel.hpp:24
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: reportmodel.cpp:22
Definition: universalid.hpp:12