#include <kdganttgraphicsitem.h>
Public Types | |
enum | { Type = UserType + 42 } |
Public Member Functions | |
void | addEndConstraint (ConstraintGraphicsItem *) |
void | addStartConstraint (ConstraintGraphicsItem *) |
QRectF | boundingRect () const |
QList< ConstraintGraphicsItem * > | endConstraints () const |
virtual QString | ganttToolTip () const |
GraphicsItem (QGraphicsItem *parent=0, GraphicsScene *scene=0) | |
GraphicsItem (const QModelIndex &idx, QGraphicsItem *parent=0, GraphicsScene *scene=0) | |
const QPersistentModelIndex & | index () const |
bool | isEditable () const |
bool | isUpdating () const |
QVariant | itemChange (GraphicsItemChange, const QVariant &value) |
void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0) |
QRectF | rect () const |
void | removeEndConstraint (ConstraintGraphicsItem *) |
void | removeStartConstraint (ConstraintGraphicsItem *) |
GraphicsScene * | scene () const |
void | setBoundingRect (const QRectF &r) |
void | setIndex (const QPersistentModelIndex &idx) |
void | setRect (const QRectF &r) |
QList< ConstraintGraphicsItem * > | startConstraints () const |
int | type () const |
void | updateItem (const Span &rowgeometry, const QPersistentModelIndex &idx) |
virtual | ~GraphicsItem () |
Protected Member Functions | |
void | focusInEvent (QFocusEvent *event) |
void | hoverLeaveEvent (QGraphicsSceneHoverEvent *) |
void | hoverMoveEvent (QGraphicsSceneHoverEvent *) |
void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *) |
void | mouseMoveEvent (QGraphicsSceneMouseEvent *) |
void | mousePressEvent (QGraphicsSceneMouseEvent *) |
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *) |
Definition at line 40 of file kdganttgraphicsitem.h.
anonymous enum |
Definition at line 42 of file kdganttgraphicsitem.h.
GraphicsItem::GraphicsItem | ( | QGraphicsItem * | parent = 0 , |
|
GraphicsScene * | scene = 0 | |||
) | [explicit] |
Definition at line 69 of file kdganttgraphicsitem.cpp.
GraphicsItem::GraphicsItem | ( | const QModelIndex & | idx, | |
QGraphicsItem * | parent = 0 , |
|||
GraphicsScene * | scene = 0 | |||
) | [explicit] |
Definition at line 75 of file kdganttgraphicsitem.cpp.
GraphicsItem::~GraphicsItem | ( | ) | [virtual] |
Definition at line 82 of file kdganttgraphicsitem.cpp.
void GraphicsItem::addEndConstraint | ( | ConstraintGraphicsItem * | item | ) |
Definition at line 241 of file kdganttgraphicsitem.cpp.
References KDGantt::ConstraintGraphicsItem::setEnd().
Referenced by KDGantt::GraphicsScene::insertItem().
void GraphicsItem::addStartConstraint | ( | ConstraintGraphicsItem * | item | ) |
Definition at line 233 of file kdganttgraphicsitem.cpp.
References KDGantt::ConstraintGraphicsItem::setStart().
Referenced by KDGantt::GraphicsScene::insertItem().
QRectF GraphicsItem::boundingRect | ( | ) | const |
Definition at line 195 of file kdganttgraphicsitem.cpp.
Referenced by mouseReleaseEvent(), and paint().
QList<ConstraintGraphicsItem*> KDGantt::GraphicsItem::endConstraints | ( | ) | const |
Definition at line 75 of file kdganttgraphicsitem.h.
Referenced by KDGantt::GraphicsScene::removeItem().
void GraphicsItem::focusInEvent | ( | QFocusEvent * | event | ) | [protected] |
Definition at line 340 of file kdganttgraphicsitem.cpp.
References index(), scene(), and KDGantt::GraphicsScene::selectionModel().
QString GraphicsItem::ganttToolTip | ( | ) | const [virtual] |
Definition at line 190 of file kdganttgraphicsitem.cpp.
References index(), KDGantt::GraphicsScene::itemDelegate(), scene(), and KDGantt::ItemDelegate::toolTip().
void GraphicsItem::hoverLeaveEvent | ( | QGraphicsSceneHoverEvent * | ) | [protected] |
Definition at line 399 of file kdganttgraphicsitem.cpp.
void GraphicsItem::hoverMoveEvent | ( | QGraphicsSceneHoverEvent * | event | ) | [protected] |
Definition at line 376 of file kdganttgraphicsitem.cpp.
References index(), KDGantt::ItemDelegate::interactionStateFor(), isEditable(), KDGantt::GraphicsScene::itemDelegate(), KDGantt::GraphicsScene::itemEntered(), scene(), KDGantt::ItemDelegate::State_ExtendLeft, KDGantt::ItemDelegate::State_ExtendRight, and KDGantt::ItemDelegate::State_Move.
const QPersistentModelIndex& KDGantt::GraphicsItem::index | ( | ) | const |
Definition at line 64 of file kdganttgraphicsitem.h.
Referenced by focusInEvent(), ganttToolTip(), hoverMoveEvent(), itemChange(), mouseDoubleClickEvent(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), paint(), and updateItem().
bool GraphicsItem::isEditable | ( | ) | const |
Definition at line 167 of file kdganttgraphicsitem.cpp.
References KDGantt::GraphicsScene::isReadOnly(), and scene().
Referenced by hoverMoveEvent(), itemChange(), mouseMoveEvent(), and mouseReleaseEvent().
bool KDGantt::GraphicsItem::isUpdating | ( | ) | const |
Definition at line 68 of file kdganttgraphicsitem.h.
Referenced by itemChange().
QVariant GraphicsItem::itemChange | ( | GraphicsItemChange | change, | |
const QVariant & | value | |||
) |
Definition at line 314 of file kdganttgraphicsitem.cpp.
References index(), isEditable(), isUpdating(), scene(), and KDGantt::GraphicsScene::selectionModel().
void GraphicsItem::mouseDoubleClickEvent | ( | QGraphicsSceneMouseEvent * | event | ) | [protected] |
Definition at line 470 of file kdganttgraphicsitem.cpp.
References index(), KDGantt::ItemDelegate::interactionStateFor(), KDGantt::GraphicsScene::itemDelegate(), KDGantt::GraphicsScene::itemDoubleClicked(), KDGantt::ItemTypeRole, scene(), and KDGantt::ItemDelegate::State_None.
void GraphicsItem::mouseMoveEvent | ( | QGraphicsSceneMouseEvent * | event | ) | [protected] |
Definition at line 512 of file kdganttgraphicsitem.cpp.
References index(), isEditable(), rect(), scene(), KDGantt::GraphicsScene::selectionModel(), KDGantt::GraphicsScene::setDragSource(), KDGantt::ItemDelegate::State_DragConstraint, KDGantt::ItemDelegate::State_ExtendLeft, KDGantt::ItemDelegate::State_ExtendRight, and KDGantt::ItemDelegate::State_Move.
void GraphicsItem::mousePressEvent | ( | QGraphicsSceneMouseEvent * | event | ) | [protected] |
Definition at line 404 of file kdganttgraphicsitem.cpp.
References index(), KDGantt::ItemDelegate::interactionStateFor(), KDGantt::GraphicsScene::itemDelegate(), KDGantt::GraphicsScene::itemPressed(), scene(), KDGantt::ItemDelegate::State_ExtendLeft, KDGantt::ItemDelegate::State_ExtendRight, and KDGantt::ItemDelegate::State_None.
void GraphicsItem::mouseReleaseEvent | ( | QGraphicsSceneMouseEvent * | event | ) | [protected] |
Definition at line 430 of file kdganttgraphicsitem.cpp.
References KDGantt::GraphicsView::addConstraint(), boundingRect(), index(), isEditable(), KDGantt::GraphicsScene::itemClicked(), rect(), scene(), and KDGantt::GraphicsScene::setDragSource().
void GraphicsItem::paint | ( | QPainter * | painter, | |
const QStyleOptionGraphicsItem * | option, | |||
QWidget * | widget = 0 | |||
) |
Definition at line 172 of file kdganttgraphicsitem.cpp.
References boundingRect(), index(), KDGantt::GraphicsScene::itemDelegate(), KDGantt::ItemDelegate::paintGanttItem(), and scene().
QRectF KDGantt::GraphicsItem::rect | ( | ) | const |
Definition at line 58 of file kdganttgraphicsitem.h.
Referenced by mouseMoveEvent(), mouseReleaseEvent(), updateItem(), and KDGantt::GraphicsScene::updateItems().
void GraphicsItem::removeEndConstraint | ( | ConstraintGraphicsItem * | item | ) |
Definition at line 256 of file kdganttgraphicsitem.cpp.
void GraphicsItem::removeStartConstraint | ( | ConstraintGraphicsItem * | item | ) |
Definition at line 249 of file kdganttgraphicsitem.cpp.
GraphicsScene * GraphicsItem::scene | ( | ) | const |
Definition at line 140 of file kdganttgraphicsitem.cpp.
Referenced by focusInEvent(), ganttToolTip(), hoverMoveEvent(), isEditable(), itemChange(), mouseDoubleClickEvent(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), paint(), and updateItem().
void GraphicsItem::setBoundingRect | ( | const QRectF & | r | ) |
Definition at line 160 of file kdganttgraphicsitem.cpp.
Referenced by updateItem().
void GraphicsItem::setIndex | ( | const QPersistentModelIndex & | idx | ) |
Definition at line 184 of file kdganttgraphicsitem.cpp.
Referenced by updateItem(), and KDGantt::GraphicsScene::updateRow().
void GraphicsItem::setRect | ( | const QRectF & | r | ) |
Definition at line 145 of file kdganttgraphicsitem.cpp.
Referenced by updateItem().
QList<ConstraintGraphicsItem*> KDGantt::GraphicsItem::startConstraints | ( | ) | const |
Definition at line 74 of file kdganttgraphicsitem.h.
Referenced by KDGantt::GraphicsScene::removeItem().
int GraphicsItem::type | ( | ) | const |
Definition at line 98 of file kdganttgraphicsitem.cpp.
void GraphicsItem::updateItem | ( | const Span & | rowgeometry, | |
const QPersistentModelIndex & | idx | |||
) |
Definition at line 277 of file kdganttgraphicsitem.cpp.
References KDGantt::GraphicsScene::grid(), index(), KDGantt::ItemDelegate::itemBoundingSpan(), KDGantt::GraphicsScene::itemDelegate(), KDGantt::ItemTypeRole, KDGantt::Span::length(), KDGantt::AbstractGrid::mapToChart(), KDGantt::AbstractRowController::maximumItemHeight(), rect(), KDGantt::GraphicsScene::rowController(), scene(), setBoundingRect(), setIndex(), setRect(), and KDGantt::Span::start().
Referenced by KDGantt::GraphicsScene::updateItems(), and KDGantt::GraphicsScene::updateRow().