KDGantt::ConstraintGraphicsItem Class Reference

#include <kdganttconstraintgraphicsitem.h>

Inheritance diagram for KDGantt::ConstraintGraphicsItem:

Inheritance graph
[legend]
Collaboration diagram for KDGantt::ConstraintGraphicsItem:

Collaboration graph
[legend]

List of all members.


Detailed Description

Definition at line 35 of file kdganttconstraintgraphicsitem.h.


Public Types

enum  { Type = UserType + 43 }

Public Member Functions

QRectF boundingRect () const
const Constraintconstraint () const
 ConstraintGraphicsItem (const Constraint &c, QGraphicsItem *parent=0, GraphicsScene *scene=0)
QPointF end () const
QString ganttToolTip () const
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Constraint proxyConstraint () const
GraphicsScenescene () const
void setEnd (const QPointF &end)
void setStart (const QPointF &start)
QPointF start () const
int type () const
void updateItem (const QPointF &start, const QPointF &end)
virtual ~ConstraintGraphicsItem ()

Member Enumeration Documentation

anonymous enum

Enumerator:
Type 

Definition at line 37 of file kdganttconstraintgraphicsitem.h.

00037 { Type = UserType + 43 };


Constructor & Destructor Documentation

ConstraintGraphicsItem::ConstraintGraphicsItem ( const Constraint c,
QGraphicsItem parent = 0,
GraphicsScene scene = 0 
) [explicit]

Definition at line 40 of file kdganttconstraintgraphicsitem.cpp.

00041     : QGraphicsItem( parent, scene ),  m_constraint( c )
00042 {
00043     setPos( QPointF( 0., 0. ) );
00044     setAcceptsHoverEvents( false );
00045     setAcceptedMouseButtons( Qt::NoButton );
00046     setZValue( 10. );
00047 }

ConstraintGraphicsItem::~ConstraintGraphicsItem (  )  [virtual]

Definition at line 49 of file kdganttconstraintgraphicsitem.cpp.

00050 {
00051 }


Member Function Documentation

QRectF ConstraintGraphicsItem::boundingRect (  )  const

Definition at line 70 of file kdganttconstraintgraphicsitem.cpp.

References KDGantt::ItemDelegate::constraintBoundingRect(), KDGantt::GraphicsScene::itemDelegate(), and scene().

00071 {
00072     return scene()->itemDelegate()->constraintBoundingRect( m_start, m_end, m_constraint );
00073 }

const Constraint& KDGantt::ConstraintGraphicsItem::constraint (  )  const

Definition at line 52 of file kdganttconstraintgraphicsitem.h.

00052 { return m_constraint; }

QPointF KDGantt::ConstraintGraphicsItem::end (  )  const

Definition at line 58 of file kdganttconstraintgraphicsitem.h.

00058 { return m_end; }

QString ConstraintGraphicsItem::ganttToolTip (  )  const

Definition at line 83 of file kdganttconstraintgraphicsitem.cpp.

References KDGantt::Constraint::data().

Referenced by KDGantt::GraphicsScene::helpEvent().

00084 {
00085     return m_constraint.data( Qt::ToolTipRole ).toString();
00086 }

void ConstraintGraphicsItem::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget widget = 0 
)

Definition at line 75 of file kdganttconstraintgraphicsitem.cpp.

References KDGantt::GraphicsScene::itemDelegate(), KDGantt::ItemDelegate::paintConstraintItem(), and scene().

00077 {
00078     Q_UNUSED( widget );
00079 
00080     scene()->itemDelegate()->paintConstraintItem( painter, *option, m_start, m_end, m_constraint );
00081 }

Constraint ConstraintGraphicsItem::proxyConstraint (  )  const

Definition at line 63 of file kdganttconstraintgraphicsitem.cpp.

References KDGantt::Constraint::endIndex(), scene(), KDGantt::Constraint::startIndex(), KDGantt::GraphicsScene::summaryHandlingModel(), and KDGantt::Constraint::type().

00064 {
00065     return Constraint( scene()->summaryHandlingModel()->mapFromSource( m_constraint.startIndex() ),
00066                        scene()->summaryHandlingModel()->mapFromSource( m_constraint.endIndex() ),
00067                        m_constraint.type() );
00068 }

GraphicsScene * ConstraintGraphicsItem::scene (  )  const

Definition at line 58 of file kdganttconstraintgraphicsitem.cpp.

Referenced by boundingRect(), paint(), and proxyConstraint().

00059 {
00060     return qobject_cast<GraphicsScene*>( QGraphicsItem::scene() );
00061 }

void ConstraintGraphicsItem::setEnd ( const QPointF &  end  ) 

Definition at line 95 of file kdganttconstraintgraphicsitem.cpp.

Referenced by KDGantt::GraphicsItem::addEndConstraint(), and updateItem().

00096 {
00097     prepareGeometryChange();
00098     m_end = end;
00099     update();
00100 }

void ConstraintGraphicsItem::setStart ( const QPointF &  start  ) 

Definition at line 88 of file kdganttconstraintgraphicsitem.cpp.

Referenced by KDGantt::GraphicsItem::addStartConstraint(), and updateItem().

00089 {
00090     prepareGeometryChange();
00091     m_start = start;
00092     update();
00093 }

QPointF KDGantt::ConstraintGraphicsItem::start (  )  const

Definition at line 56 of file kdganttconstraintgraphicsitem.h.

00056 { return m_start; }

int ConstraintGraphicsItem::type (  )  const

Definition at line 53 of file kdganttconstraintgraphicsitem.cpp.

References Type.

00054 {
00055     return Type;
00056 }

void ConstraintGraphicsItem::updateItem ( const QPointF &  start,
const QPointF &  end 
)

Definition at line 102 of file kdganttconstraintgraphicsitem.cpp.

References setEnd(), and setStart().

00103 {
00104     setStart( start );
00105     setEnd( end );
00106 }


The documentation for this class was generated from the following files:
Generated on Thu Mar 4 23:27:00 2010 for KD Chart 2 by  doxygen 1.5.4