-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqgraphicsitemcomposite.h
34 lines (28 loc) · 1.01 KB
/
qgraphicsitemcomposite.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
#ifndef GRAFICSITEMCOMPOSITE_HPP
#define GRAFICSITEMCOMPOSITE_HPP
#include <QList>
#include "qgraphicsitemprototype.h"
class QGraphicsItemComposite : public QGraphicsItem, public ColorSetter
{
public:
typedef QList<QGraphicsItem*> Composite;
typedef Composite::iterator Iterator;
typedef Composite::const_iterator ConstIterator;
QGraphicsItemComposite(QGraphicsItem *parent = 0);
QGraphicsItemComposite(const QGraphicsItemComposite&) = delete;
Composite release();
void add(QGraphicsItem* component);
void remove(QGraphicsItem* component);
QGraphicsItem* getChild(int index);
const QGraphicsItem* getChild(int index) const;
bool contains(QGraphicsItem* item) const;
void adjustPosition();
virtual QRectF boundingRect() const final;
virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) final;
virtual void setColor(QColor color) final;
protected:
void computeSize(qreal &xmin, qreal &xmax, qreal &ymin, qreal &ymax) const;
private:
Composite children;
};
#endif // GRAFICSITEMCOMPOSITE_HPP