-
Notifications
You must be signed in to change notification settings - Fork 1
/
rmapobject.h
executable file
·64 lines (46 loc) · 1.64 KB
/
rmapobject.h
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 RMAPOBJECT_H
#define RMAPOBJECT_H
#include <QWidget>
class QModelIndex;
class QMouseEvent;
class RMapObjectModel;
class RMapObjectMovePolicy;
class RMapObjectResizePolicy;
class RMapObjectTreeWidgetItem;
class RMapObjectFocusHolder;
//--------------------------------------------------------------------------------------
class RMapObject : public QWidget {
Q_OBJECT
public:
explicit RMapObject(QWidget *parent);
virtual ~RMapObject();
virtual RMapObject *clone() const = 0;
virtual RMapObjectModel *model() const;
virtual void setModel(RMapObjectModel *m);
RMapObjectMovePolicy *movePolicy() const;
void setMovePolicy(RMapObjectMovePolicy *policy);
RMapObjectResizePolicy *resizePolicy() const;
void setResizePolicy(RMapObjectResizePolicy *policy);
RMapObjectTreeWidgetItem *treeWidgetItem() const;
bool hasFocusMapObject() const;
void setFocusMapObject();
protected:
virtual void mousePressEvent(QMouseEvent *event);
virtual void mouseMoveEvent(QMouseEvent *event);
virtual void mouseReleaseEvent(QMouseEvent *event);
virtual void keyPressEvent(QKeyEvent *event);
virtual void resizeEvent(QResizeEvent *event);
virtual void moveEvent(QMoveEvent *event);
virtual void focusSetEvent();
virtual void focusLostEvent();
virtual void updateTreeWidgetItem();
protected slots:
void modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
private:
RMapObjectModel *mapObjectModel;
RMapObjectMovePolicy *mapObjectMovePolicy;
RMapObjectResizePolicy *mapObjectResizePolicy;
RMapObjectTreeWidgetItem *mapObjectTreeWidgetItem;
friend class RMapObjectFocusHolder;
};
#endif // RMAPOBJECT_H