Crossfire Server, Trunk
CREMessageItemModel.h
Go to the documentation of this file.
1 #ifndef CREMESSAGEITEMMODEL_H
2 #define CREMESSAGEITEMMODEL_H
3 
4 #include <QObject>
5 #include <QAbstractItemModel>
6 
7 #include "MessageFile.h"
8 
12 class CREMessageItemModel : public QAbstractItemModel
13 {
14 public:
15  CREMessageItemModel(QObject* parent);
16  virtual ~CREMessageItemModel();
17 
19 
20  void setSelectedRule(const QModelIndex& index);
21 
22  virtual int columnCount(const QModelIndex& parent) const override;
23  virtual QModelIndex index(int row, int column, const QModelIndex& parent) const override;
24  virtual QModelIndex parent(const QModelIndex& index) const override;
25  virtual int rowCount(const QModelIndex & parent) const override;
26  virtual QVariant data(const QModelIndex& index, int role) const override;
27  virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
28  virtual Qt::ItemFlags flags(const QModelIndex& index) const override;
29  virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
30  virtual bool insertRows(int row, int count, const QModelIndex& parent = QModelIndex()) override;
31  virtual bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex()) override;
32 
33  void moveUpDown(int row, bool up);
34  void duplicateRow(int row);
35 
36 protected:
38  QSet<int> myBlue, myRed;
39 };
40 
41 #endif /* CREMESSAGEITEMMODEL_H */
42 
CREMessageItemModel::index
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const override
Definition: CREMessageItemModel.cpp:131
CREMessageItemModel::insertRows
virtual bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
Definition: CREMessageItemModel.cpp:268
CREMessageItemModel::myRed
QSet< int > myRed
Definition: CREMessageItemModel.h:38
CREMessageItemModel::data
virtual QVariant data(const QModelIndex &index, int role) const override
Definition: CREMessageItemModel.cpp:159
CREMessageItemModel::setMessage
void setMessage(MessageFile *message)
Definition: CREMessageItemModel.cpp:13
CREMessageItemModel::myMessage
MessageFile * myMessage
Definition: CREMessageItemModel.h:37
CREMessageItemModel::moveUpDown
void moveUpDown(int row, bool up)
Definition: CREMessageItemModel.cpp:304
CREMessageItemModel::~CREMessageItemModel
virtual ~CREMessageItemModel()
Definition: CREMessageItemModel.cpp:9
MessageFile
Definition: MessageFile.h:56
CREMessageItemModel::CREMessageItemModel
CREMessageItemModel(QObject *parent)
Definition: CREMessageItemModel.cpp:5
CREMessageItemModel::removeRows
virtual bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
Definition: CREMessageItemModel.cpp:285
CREMessageItemModel::columnCount
virtual int columnCount(const QModelIndex &parent) const override
Definition: CREMessageItemModel.cpp:124
CREMessageItemModel::rowCount
virtual int rowCount(const QModelIndex &parent) const override
Definition: CREMessageItemModel.cpp:143
disinfect.count
int count
Definition: disinfect.py:7
CREMessageItemModel
Definition: CREMessageItemModel.h:12
CREMessageItemModel::flags
virtual Qt::ItemFlags flags(const QModelIndex &index) const override
Definition: CREMessageItemModel.cpp:222
diamondslots.message
string message
Definition: diamondslots.py:57
MessageFile.h
autojail.value
value
Definition: autojail.py:6
CREMessageItemModel::setSelectedRule
void setSelectedRule(const QModelIndex &index)
Definition: CREMessageItemModel.cpp:20
CREMessageItemModel::headerData
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const override
Definition: CREMessageItemModel.cpp:198
CREMessageItemModel::myBlue
QSet< int > myBlue
Definition: CREMessageItemModel.h:38
CREMessageItemModel::parent
virtual QModelIndex parent(const QModelIndex &index) const override
Definition: CREMessageItemModel.cpp:138
CREMessageItemModel::setData
virtual bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Definition: CREMessageItemModel.cpp:229
CREMessageItemModel::duplicateRow
void duplicateRow(int row)
Definition: CREMessageItemModel.cpp:321