KD Chart 2
[rev.2.7]
|
Class used to render gantt items in a KDGantt::GraphicsView. More...
#include <KDGanttItemDelegate>
Public Types | |
enum | InteractionState { State_None = 0, State_Move, State_ExtendLeft, State_ExtendRight, State_DragConstraint } |
Public Member Functions | |
virtual QRectF | constraintBoundingRect (const QPointF &start, const QPointF &end, const Constraint &constraint) const |
QBrush | defaultBrush (ItemType type) const |
QPen | defaultPen (ItemType type) const |
virtual InteractionState | interactionStateFor (const QPointF &pos, const StyleOptionGanttItem &opt, const QModelIndex &idx) const |
virtual Span | itemBoundingSpan (const StyleOptionGanttItem &opt, const QModelIndex &idx) const |
ItemDelegate (QObject *parent=0) | |
virtual void | paintConstraintItem (QPainter *p, const QStyleOptionGraphicsItem &opt, const QPointF &start, const QPointF &end, const Constraint &constraint) |
virtual void | paintGanttItem (QPainter *p, const StyleOptionGanttItem &opt, const QModelIndex &idx) |
void | setDefaultBrush (ItemType type, const QBrush &brush) |
void | setDefaultPen (ItemType type, const QPen &pen) |
virtual QString | toolTip (const QModelIndex &idx) const |
~ItemDelegate () override | |
Protected Member Functions | |
QPolygonF | finishFinishArrow (const QPointF &start, const QPointF &end) const |
QPolygonF | finishFinishLine (const QPointF &start, const QPointF &end) const |
QPolygonF | finishStartArrow (const QPointF &start, const QPointF &end) const |
QPolygonF | finishStartLine (const QPointF &start, const QPointF &end) const |
void | paintFinishFinishConstraint (QPainter *p, const QStyleOptionGraphicsItem &opt, const QPointF &start, const QPointF &end, const Constraint &constraint) |
void | paintFinishStartConstraint (QPainter *p, const QStyleOptionGraphicsItem &opt, const QPointF &start, const QPointF &end, const Constraint &constraint) |
void | paintStartFinishConstraint (QPainter *p, const QStyleOptionGraphicsItem &opt, const QPointF &start, const QPointF &end, const Constraint &constraint) |
void | paintStartStartConstraint (QPainter *p, const QStyleOptionGraphicsItem &opt, const QPointF &start, const QPointF &end, const Constraint &constraint) |
QPolygonF | startFinishArrow (const QPointF &start, const QPointF &end) const |
QPolygonF | startFinishLine (const QPointF &start, const QPointF &end) const |
QPolygonF | startStartArrow (const QPointF &start, const QPointF &end) const |
QPolygonF | startStartLine (const QPointF &start, const QPointF &end) const |
Class used to render gantt items in a KDGantt::GraphicsView.
Definition at line 37 of file kdganttitemdelegate.h.
This enum is used for communication between the view and the delegate about user interaction with gantt items.
Enumerator | |
---|---|
State_None | |
State_Move | |
State_ExtendLeft | |
State_ExtendRight | |
State_DragConstraint |
Definition at line 41 of file kdganttitemdelegate.h.
|
explicit |
Constructor. Creates an ItemDelegate with parent parent
Definition at line 123 of file kdganttitemdelegate.cpp.
|
override |
Destructor
Definition at line 129 of file kdganttitemdelegate.cpp.
|
virtual |
Definition at line 400 of file kdganttitemdelegate.cpp.
References KDGantt::Constraint::FinishFinish, finishFinishArrow(), finishFinishLine(), KDGantt::Constraint::FinishStart, finishStartArrow(), finishStartLine(), PW, KDGantt::Constraint::relationType(), KDGantt::Constraint::StartFinish, startFinishArrow(), startFinishLine(), KDGantt::Constraint::StartStart, startStartArrow(), and startStartLine().
Referenced by KDGantt::ConstraintGraphicsItem::boundingRect().
QBrush ItemDelegate::defaultBrush | ( | ItemType | type | ) | const |
Definition at line 151 of file kdganttitemdelegate.cpp.
References d.
Referenced by paintGanttItem().
QPen ItemDelegate::defaultPen | ( | ItemType | type | ) | const |
Definition at line 171 of file kdganttitemdelegate.cpp.
References d.
Referenced by paintGanttItem().
|
protected |
Definition at line 527 of file kdganttitemdelegate.cpp.
References TURN.
Referenced by constraintBoundingRect(), and paintFinishFinishConstraint().
|
protected |
Definition at line 505 of file kdganttitemdelegate.cpp.
References TURN.
Referenced by constraintBoundingRect(), and paintFinishFinishConstraint().
|
protected |
Definition at line 481 of file kdganttitemdelegate.cpp.
References TURN.
Referenced by constraintBoundingRect(), and paintFinishStartConstraint().
|
protected |
Definition at line 459 of file kdganttitemdelegate.cpp.
References TURN.
Referenced by constraintBoundingRect(), and paintFinishStartConstraint().
|
virtual |
Override to implement new items or interactions.
Definition at line 238 of file kdganttitemdelegate.cpp.
References KDGantt::StyleOptionGanttItem::itemRect, KDGantt::ItemTypeRole, State_ExtendLeft, State_ExtendRight, State_Move, State_None, KDGantt::TypeEvent, KDGantt::TypeNone, and KDGantt::TypeSummary.
Referenced by KDGantt::GraphicsItem::hoverMoveEvent(), KDGantt::GraphicsItem::mouseDoubleClickEvent(), and KDGantt::GraphicsItem::mousePressEvent().
|
virtual |
Override this to implement new itemtypes or to change the look of the existing ones.
Definition at line 200 of file kdganttitemdelegate.cpp.
References KDGantt::StyleOptionGanttItem::Center, KDGantt::StyleOptionGanttItem::displayPosition, KDGantt::StyleOptionGanttItem::Hidden, KDGantt::StyleOptionGanttItem::itemRect, KDGantt::ItemTypeRole, KDGantt::StyleOptionGanttItem::Left, KDGantt::StyleOptionGanttItem::Right, and KDGantt::TypeEvent.
Referenced by KDGantt::GraphicsItem::boundingRect(), and KDGantt::GraphicsItem::updateItem().
|
virtual |
Paints the constraint between points start and end using painter and opt.
Definition at line 426 of file kdganttitemdelegate.cpp.
References KDGantt::Constraint::FinishFinish, KDGantt::Constraint::FinishStart, paintFinishFinishConstraint(), paintFinishStartConstraint(), paintStartFinishConstraint(), paintStartStartConstraint(), KDGantt::Constraint::relationType(), KDGantt::Constraint::StartFinish, and KDGantt::Constraint::StartStart.
Referenced by KDGantt::ConstraintGraphicsItem::paint().
|
protected |
Definition at line 492 of file kdganttitemdelegate.cpp.
References d, finishFinishArrow(), and finishFinishLine().
Referenced by paintConstraintItem().
|
protected |
Definition at line 446 of file kdganttitemdelegate.cpp.
References d, finishStartArrow(), and finishStartLine().
Referenced by paintConstraintItem().
|
virtual |
Paints the gantt item idx using painter and opt
Definition at line 273 of file kdganttitemdelegate.cpp.
References KDGantt::StyleOptionGanttItem::boundingRect, KDGantt::StyleOptionGanttItem::Center, defaultBrush(), defaultPen(), KDGantt::StyleOptionGanttItem::displayPosition, KDGantt::StyleOptionGanttItem::Hidden, KDGantt::StyleOptionGanttItem::itemRect, KDGantt::ItemTypeRole, KDGantt::StyleOptionGanttItem::Left, KDGantt::StyleOptionGanttItem::Right, KDGantt::TaskCompletionRole, KDGantt::StyleOptionGanttItem::text, KDGantt::TypeEvent, KDGantt::TypeSummary, and KDGantt::TypeTask.
Referenced by KDGantt::Legend::drawItem(), and KDGantt::GraphicsItem::paint().
|
protected |
Definition at line 584 of file kdganttitemdelegate.cpp.
References d, startFinishArrow(), and startFinishLine().
Referenced by paintConstraintItem().
|
protected |
Definition at line 538 of file kdganttitemdelegate.cpp.
References d, startStartArrow(), and startStartLine().
Referenced by paintConstraintItem().
void ItemDelegate::setDefaultBrush | ( | ItemType | type, |
const QBrush & | brush | ||
) |
Sets the default brush used for items of type type to brush. The default brush is used in the case when the model does not provide an explicit brush.
Definition at line 142 of file kdganttitemdelegate.cpp.
References d.
void ItemDelegate::setDefaultPen | ( | ItemType | type, |
const QPen & | pen | ||
) |
Sets the default pen used for items of type type to pen. The default pen is used in the case when the model does not provide an explicit pen.
Definition at line 162 of file kdganttitemdelegate.cpp.
References d.
|
protected |
Definition at line 621 of file kdganttitemdelegate.cpp.
References TURN.
Referenced by constraintBoundingRect(), and paintStartFinishConstraint().
|
protected |
Definition at line 597 of file kdganttitemdelegate.cpp.
References TURN.
Referenced by constraintBoundingRect(), and paintStartFinishConstraint().
|
protected |
Definition at line 573 of file kdganttitemdelegate.cpp.
References TURN.
Referenced by constraintBoundingRect(), and paintStartStartConstraint().
|
protected |
Definition at line 552 of file kdganttitemdelegate.cpp.
References TURN.
Referenced by constraintBoundingRect(), and paintStartStartConstraint().
|
virtual |
Definition at line 178 of file kdganttitemdelegate.cpp.
References KDGantt::EndTimeRole, and KDGantt::StartTimeRole.
Referenced by KDGantt::GraphicsItem::ganttToolTip().