23 #ifndef KDGANTTGRAPHICSITEM_H 24 #define KDGANTTGRAPHICSITEM_H 29 #include <QGraphicsItem> 31 #include <QPersistentModelIndex> 34 class QGraphicsLineItem;
39 class ConstraintGraphicsItem;
44 enum {
Type = UserType + 42 };
53 void updateItem(
const Span& rowgeometry,
const QPersistentModelIndex& idx );
60 QRectF
rect()
const {
return m_rect; }
61 void setRect(
const QRectF& r );
66 const QPersistentModelIndex&
index()
const {
return m_index; }
67 void setIndex(
const QPersistentModelIndex& idx );
80 void paint( QPainter* painter,
const QStyleOptionGraphicsItem* option,
83 QVariant
itemChange( GraphicsItemChange,
const QVariant& value );
96 QPointF startConnector(
int relationType )
const;
97 QPointF endConnector(
int relationType )
const;
98 void updateConstraintItems();
101 void updateItemFromMouse(
const QPointF& scenepos );
102 void constraintsChanged();
105 QRectF m_boundingrect;
106 QPersistentModelIndex m_index;
110 QPointF m_pressscenepos;
111 QGraphicsLineItem* m_dragline;
void setRect(const QRectF &r)
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *)
virtual QString ganttToolTip() const
GraphicsItem(QGraphicsItem *parent=0, GraphicsScene *scene=0)
void mousePressEvent(QGraphicsSceneMouseEvent *)
void updateItem(const Span &rowgeometry, const QPersistentModelIndex &idx)
void mouseReleaseEvent(QGraphicsSceneMouseEvent *)
void addStartConstraint(ConstraintGraphicsItem *)
const QPersistentModelIndex & index() const
void focusInEvent(QFocusEvent *event)
A class representing a start point and a length.
void hoverMoveEvent(QGraphicsSceneHoverEvent *)
void hoverLeaveEvent(QGraphicsSceneHoverEvent *)
void setBoundingRect(const QRectF &r)
QStyleOption subclass for gantt items.
void removeStartConstraint(ConstraintGraphicsItem *)
QList< ConstraintGraphicsItem * > endConstraints() const
void addEndConstraint(ConstraintGraphicsItem *)
void setIndex(const QPersistentModelIndex &idx)
GraphicsScene * scene() const
QVariant itemChange(GraphicsItemChange, const QVariant &value)
QRectF boundingRect() const
QList< ConstraintGraphicsItem * > startConstraints() const
void mouseMoveEvent(QGraphicsSceneMouseEvent *)
void removeEndConstraint(ConstraintGraphicsItem *)