29 #ifndef __GRAPHICSCOMPONENTITEM_H__
30 #define __GRAPHICSCOMPONENTITEM_H__
32 #include <QGraphicsRectItem>
33 #include <QGraphicsSimpleTextItem>
34 #include <QGraphicsScene>
36 #include <arcs/arcsabstractcomponent.h>
39 #include "graphicsportitem.h"
48 enum { Type = UserType + 1 };
55 void addSignal(QString s,
bool updateSheet =
true);
56 void addSlot(QString s,
bool updateSheet =
true);
58 bool isMarkedForDeletion() {
return markedForDeletion; }
60 void markForDeletion() { markedForDeletion =
true; }
61 void removePort(QString name);
64 if (slotPorts.contains(name))
65 return slotPorts[name];
70 if (signalPorts.contains(name))
71 return signalPorts[name];
77 virtual void hoverEnterEvent ( QGraphicsSceneHoverEvent * );
78 virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * );
79 virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
80 virtual QVariant
itemChange ( GraphicsItemChange change,
const QVariant & value );
81 virtual void paint(QPainter *painter,
const QStyleOptionGraphicsItem *option, QWidget *widget);
82 virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *);
86 QGraphicsSimpleTextItem* componentLabel;
87 QMap<QString,GraphicsPortItem*> slotPorts;
88 QMap<QString,GraphicsPortItem*> signalPorts;
90 bool markedForDeletion;
95 #endif // __GRAPHICSCOMPONENTITEM_H__
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value)
Class handling the generic description of a component.