1 #ifndef __GROUPITEM_H__
2 #define __GROUPITEM_H__
9 #include "AbstractBoxItem.h"
10 class AbstractBoxItem;
17 #include "Exception.h"
22 class GroupItem : public AbstractBoxItem {
25 /* CAUTION : the parentItem of a group block IS NOT the group item of the parent scene. It is a BlockItem that is
26 wihtin the parent scene. It is used when interfaceItem are added to the current GroupItem: they must be also added
27 to the parent BlockItem.
29 NB : this yields a problem when loading a project because scenes are created before creating group and then block.
30 thus, the parentItem must be initialized afterward when all block items have been created.
33 GroupItem(BoxItem* _parentItem, AbstractBlock *_refBlock, Dispatcher *_dispatcher, Parameters *_params) throw(Exception);
37 BoxItem* getParentItem();
46 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
47 void save(QXmlStreamWriter& writer);
51 void updateMinimumSize(); // modify the minimum size
52 bool updateGeometry(ChangeType type);
54 void mousePressEvent(QGraphicsSceneMouseEvent *event);
55 void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
56 void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
57 void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
58 void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
63 /* NOTE : parentItem attribute is never NULL except for the top GroupItem
70 InterfaceItem *isHoverInterface(QPointF point);
73 #endif // __GROUPITEM_H__