#ifndef GRAPHICSITEMGROUP_H
#define GRAPHICSITEMGROUP_H

#include "graphicsBaseItem.h"

class GraphicsItemGroup : public QObject, public AbstractShapeType<QGraphicsItemGroup>
{
    Q_OBJECT

public:
    GraphicsItemGroup(QGraphicsItem *parent = 0);
    virtual ~GraphicsItemGroup();

    void resize(int,double, double, const QPointF&) override;
    void updateCoordinate() override;

    void createOperationCopy() override;
    void removeOperationCopy() override;
    void moveOperationCopy(const QPointF&) override;
    void rotateOperationCopy(const double&) override;
    QJsonObject serialize() const override;
    static QGraphicsItem *createFromJson(const QJsonObject &obj);

    void addItems(const QList<QGraphicsItem*>&);
    //QList<QGraphicsItem*> getItems() {return m_listItem;}

protected:
    QPainterPath shape() override;
    void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*) override;
    void contextMenuEvent(QGraphicsSceneContextMenuEvent*) override;
    QVariant itemChange(QGraphicsItem::GraphicsItemChange, const QVariant&) override;
    void syncRotationDataFromParent(const double&) override;

private:
    QRectF        m_lastBoudingRect; //记录上一时刻的boundingRect
    QPainterPath  m_painterPath;
    //QList<QGraphicsItem*> m_listItem;
};

#endif
