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 };
50 int type()
const override;
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 )
override;
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 mouseReleaseEvent(QGraphicsSceneMouseEvent *) override
void setRect(const QRectF &r)
virtual QString ganttToolTip() const
void mousePressEvent(QGraphicsSceneMouseEvent *) override
GraphicsItem(QGraphicsItem *parent=0, GraphicsScene *scene=0)
void updateItem(const Span &rowgeometry, const QPersistentModelIndex &idx)
QRectF boundingRect() const override
void addStartConstraint(ConstraintGraphicsItem *)
const QPersistentModelIndex & index() const
QVariant itemChange(GraphicsItemChange, const QVariant &value) override
void hoverLeaveEvent(QGraphicsSceneHoverEvent *) override
A class representing a start point and a length.
void hoverMoveEvent(QGraphicsSceneHoverEvent *) override
void focusInEvent(QFocusEvent *event) override
void setBoundingRect(const QRectF &r)
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *) override
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0) override
QStyleOption subclass for gantt items.
void removeStartConstraint(ConstraintGraphicsItem *)
int type() const override
QList< ConstraintGraphicsItem * > endConstraints() const
void addEndConstraint(ConstraintGraphicsItem *)
void setIndex(const QPersistentModelIndex &idx)
GraphicsScene * scene() const
QList< ConstraintGraphicsItem * > startConstraints() const
void removeEndConstraint(ConstraintGraphicsItem *)
void mouseMoveEvent(QGraphicsSceneMouseEvent *) override