-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrmapobjectmodel.h
More file actions
executable file
·64 lines (49 loc) · 1.48 KB
/
Copy pathrmapobjectmodel.h
File metadata and controls
executable file
·64 lines (49 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef RMAPOBJECTMODEL_H
#define RMAPOBJECTMODEL_H
#include <QAbstractTableModel>
#include <QRect>
class RMapObjectModel : public QAbstractTableModel {
Q_OBJECT
public:
explicit RMapObjectModel(QObject *parent = 0);
virtual ~RMapObjectModel();
virtual RMapObjectModel *clone() const = 0;
virtual int columnCount(const QModelIndex &parent) const;
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
virtual QVariant data(const QModelIndex &index, int role) const;
virtual bool setData(const QModelIndex &index, const QVariant &value, int role);
virtual const QString &caption() const = 0;
virtual bool isValid() const;
const QRect &mapObjectGeometry() const;
virtual void setMapObjectGeometry(const QRect &rect);
bool isModified() const;
void setModified(bool modify);
int mapObjectID() const;
void setMapObjectID(int id);
enum COLUMNS {
EN_PROPERTY = 0,
EN_VALUE,
EN_COLUMNS_COUNT
};
enum SECTIONS {
EN_XPOS = 0,
EN_YPOS,
EN_WIDTH,
EN_HEIGHT,
EN_SECTIONS_COUNT
};
enum EDIT_TYPE {
ET_FONT_SELECTOR = 1,
ET_COLOR_SELECTOR,
ET_PICTURE_SELECTOR,
ET_REFS_SELECTOR
};
protected:
void initModel(RMapObjectModel *m) const;
private:
QRect map_object_geometry;
bool is_modify;
int map_object_id;
};
#endif // RMAPOBJECTMODEL_H