новые иконки в OpenBoard
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
OpenBoard/src/domain/UBGraphicsGroupContainerItem.h

55 lines
1.5 KiB

#ifndef UBGRAPHICSGROUPCONTAINERITEM_H
#define UBGRAPHICSGROUPCONTAINERITEM_H
#include <QGraphicsItem>
#include "domain/UBItem.h"
class UBGraphicsGroupContainerItem : public QGraphicsItem, public UBItem, public UBGraphicsItem
{
public:
UBGraphicsGroupContainerItem (QGraphicsItem *parent = 0);
void addToGroup(QGraphicsItem *item);
void removeFromGroup(QGraphicsItem *item);
void setCurrentItem(QGraphicsItem *item){mCurrentItem = item;}
QGraphicsItem *getCurrentItem() const {return mCurrentItem;}
void deselectCurrentItem();
QRectF boundingRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
virtual UBGraphicsItemDelegate* Delegate() const { return mDelegate;}
virtual UBGraphicsScene* scene();
virtual UBGraphicsGroupContainerItem *deepCopy() const;
virtual void remove();
enum { Type = UBGraphicsItemType::groupContainerType };
virtual int type() const
{
return Type;
}
virtual void setUuid(const QUuid &pUuid);
void destroy();
protected:
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
void pRemoveFromGroup(QGraphicsItem *item);
private:
QRectF itemsBoundingRect;
QGraphicsItem *mCurrentItem;
};
#endif // UBGRAPHICSGROUPCONTAINERITEM_H