Public Member Functions | Protected Slots | Protected Member Functions

KDGantt::Legend Class Reference

Legend showing an image and a description for Gantt items. More...

#include <KDGanttLegend>

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

List of all members.

Public Member Functions

QModelIndex indexAt (const QPoint &point) const
 Legend (QWidget *parent=0)
QSize minimumSizeHint () const
void scrollTo (const QModelIndex &, ScrollHint=EnsureVisible)
void setModel (QAbstractItemModel *model)
QSize sizeHint () const
QRect visualRect (const QModelIndex &index) const
virtual ~Legend ()

Protected Slots

virtual void modelDataChanged ()

Protected Member Functions

virtual QRect drawItem (QPainter *painter, const QModelIndex &index, const QPoint &pos=QPoint()) const
virtual StyleOptionGanttItem getStyleOption (const QModelIndex &index) const
int horizontalOffset () const
bool isIndexHidden (const QModelIndex &) const
virtual QSize measureItem (const QModelIndex &index, bool recursive=true) const
QModelIndex moveCursor (CursorAction, Qt::KeyboardModifiers)
void paintEvent (QPaintEvent *event)
void setSelection (const QRect &, QItemSelectionModel::SelectionFlags)
int verticalOffset () const
QRegion visualRegionForSelection (const QItemSelection &) const

Detailed Description

Legend showing an image and a description for Gantt items.

This is an item view class showing a small Gantt item and it's text defined by LegendRole.

Definition at line 33 of file kdganttlegend.h.


Constructor & Destructor Documentation

Legend::Legend ( QWidget parent = 0  )  [explicit]

Constructor. Creates a Legend with parent parent. The QObject parent is not used for anything internally.

Definition at line 45 of file kdganttlegend.cpp.

Legend::~Legend (  )  [virtual]

Destructor. Does nothing

Definition at line 54 of file kdganttlegend.cpp.


Member Function Documentation

QRect Legend::drawItem ( QPainter *  painter,
const QModelIndex &  index,
const QPoint &  pos = QPoint() 
) const [protected, virtual]

Draws the legend item at index and all of it's children recursively at pos onto painter. Reimplement this if you want to draw items in an user defined way.

Returns:
the rectangle drawn.

Definition at line 142 of file kdganttlegend.cpp.

References KDGantt::StyleOptionGanttItem::boundingRect, d, getStyleOption(), KDGantt::StyleOptionGanttItem::itemRect, KDGantt::ItemTypeRole, measureItem(), KDGantt::ItemDelegate::paintGanttItem(), and KDGantt::StyleOptionGanttItem::text.

Referenced by paintEvent().

StyleOptionGanttItem Legend::getStyleOption ( const QModelIndex &  index  )  const [protected, virtual]

Creates a StyleOptionGanttItem with all style options filled in except the target rectangles.

Definition at line 127 of file kdganttlegend.cpp.

References d, KDGantt::StyleOptionGanttItem::displayPosition, KDGantt::LegendRole, and KDGantt::StyleOptionGanttItem::text.

Referenced by drawItem().

int KDGantt::Legend::horizontalOffset (  )  const [protected]

Definition at line 58 of file kdganttlegend.h.

QModelIndex Legend::indexAt ( const QPoint &  point  )  const

Definition at line 61 of file kdganttlegend.cpp.

bool KDGantt::Legend::isIndexHidden ( const QModelIndex &   )  const [protected]

Definition at line 59 of file kdganttlegend.h.

QSize Legend::measureItem ( const QModelIndex &  index,
bool  recursive = true 
) const [protected, virtual]

Calculates the needed space for the legend item at index and, if recursive is true, all child items.

Definition at line 184 of file kdganttlegend.cpp.

References d, and KDGantt::LegendRole.

Referenced by drawItem(), minimumSizeHint(), and sizeHint().

QSize Legend::minimumSizeHint (  )  const

Definition at line 78 of file kdganttlegend.cpp.

References measureItem().

void Legend::modelDataChanged (  )  [protected, virtual, slot]

Triggers repainting of the legend.

Definition at line 106 of file kdganttlegend.cpp.

Referenced by setModel().

QModelIndex KDGantt::Legend::moveCursor ( CursorAction  ,
Qt::KeyboardModifiers   
) [protected]

Definition at line 60 of file kdganttlegend.h.

void Legend::paintEvent ( QPaintEvent *  event  )  [protected]

Definition at line 112 of file kdganttlegend.cpp.

References drawItem().

void KDGantt::Legend::scrollTo ( const QModelIndex &  ,
ScrollHint  = EnsureVisible 
)

Definition at line 44 of file kdganttlegend.h.

void Legend::setModel ( QAbstractItemModel *  model  ) 

Definition at line 83 of file kdganttlegend.cpp.

References d, and modelDataChanged().

void KDGantt::Legend::setSelection ( const QRect &  ,
QItemSelectionModel::SelectionFlags   
) [protected]

Definition at line 61 of file kdganttlegend.h.

QSize Legend::sizeHint (  )  const

Definition at line 73 of file kdganttlegend.cpp.

References measureItem().

int KDGantt::Legend::verticalOffset (  )  const [protected]

Definition at line 62 of file kdganttlegend.h.

QRect Legend::visualRect ( const QModelIndex &  index  )  const

Definition at line 67 of file kdganttlegend.cpp.

QRegion KDGantt::Legend::visualRegionForSelection ( const QItemSelection &   )  const [protected]

Definition at line 63 of file kdganttlegend.h.


The documentation for this class was generated from the following files: