-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgroupelement.h
67 lines (49 loc) · 1.46 KB
/
groupelement.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
65
66
67
#ifndef GROUPELEMENT_H
#define GROUPELEMENT_H
#include "baseelement.h"
class BaseGroupElement : public BaseElement
{
Q_OBJECT
public:
BaseGroupElement(BaseElement *parent, BaseSpace *space, QRectF initRect);
void addToGroup(BaseElement *element);
void removeFromGroup(BaseElement *element);
bool isObscuredBy(const QGraphicsItem *item) const override;
QPainterPath opaqueArea() const override;
inline QList<BaseElement *> childElements() const { return m_childElements;}
//remove all elements from list and reset their parent to scene
void clear();
protected:
BasePicker *createPicker() override;
private:
QList<BaseElement *> m_childElements;
};
class GroupPickerElement : public BaseGroupElement
{
Q_OBJECT
enum { Type = QGraphicsItem::UserType + GRAPHICSITEM_TYPE_GROUP_PICKER};
public:
int type() const override
{
// Enable the use of qgraphicsitem_cast with this item.
return Type;
}
GroupPickerElement(
BaseSpace * space
);
};
class GroupElement : public BaseGroupElement
{
Q_OBJECT
enum { Type = QGraphicsItem::UserType + GRAPHICSITEM_TYPE_GROUP};
public:
int type() const override
{
// Enable the use of qgraphicsitem_cast with this item.
return Type;
}
GroupElement(
BaseElement *parent,
BaseSpace * space);
};
#endif // GROUPELEMENT_H