![]() |
KD Chart API Documentation
3.1
|
Legend showing an image and a description for Gantt items. More...
#include <KDGanttLegend>
Public Member Functions | |
Legend (QWidget *parent=nullptr) | |
Constructor. More... | |
~Legend () override | |
Destructor. More... | |
QModelIndex | indexAt (const QPoint &point) const override |
QSize | minimumSizeHint () const override |
void | scrollTo (const QModelIndex &, ScrollHint=EnsureVisible) override |
void | setModel (QAbstractItemModel *model) override |
QSize | sizeHint () const override |
QRect | visualRect (const QModelIndex &index) const override |
Protected Slots | |
virtual void | modelDataChanged () |
Triggers repainting of the legend. More... | |
Protected Member Functions | |
virtual QRect | drawItem (QPainter *painter, const QModelIndex &index, const QPoint &pos=QPoint()) const |
Draws the legend item at index and all of it's children recursively at pos onto painter. More... | |
virtual StyleOptionGanttItem | getStyleOption (const QModelIndex &index) const |
Creates a StyleOptionGanttItem with all style options filled in except the target rectangles. More... | |
int | horizontalOffset () const override |
bool | isIndexHidden (const QModelIndex &) const override |
virtual QSize | measureItem (const QModelIndex &index, bool recursive=true) const |
Calculates the needed space for the legend item at index and, if recursive is true, all child items. More... | |
QModelIndex | moveCursor (CursorAction, Qt::KeyboardModifiers) override |
void | paintEvent (QPaintEvent *event) override |
void | setSelection (const QRect &, QItemSelectionModel::SelectionFlags) override |
int | verticalOffset () const override |
QRegion | visualRegionForSelection (const QItemSelection &) const override |
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 20 of file kdganttlegend.h.
|
explicit |
Constructor.
Creates a Legend with parent parent. The QObject parent is not used for anything internally.
Definition at line 33 of file kdganttlegend.cpp.
|
override |
|
protectedvirtual |
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.
Definition at line 128 of file kdganttlegend.cpp.
References KDGantt::StyleOptionGanttItem::boundingRect, d, getStyleOption(), KDGantt::StyleOptionGanttItem::itemRect, KDGantt::ItemTypeRole, measureItem(), KDGantt::StyleOptionGanttItem::text, and KDGantt::TypeEvent.
Referenced by paintEvent().
|
protectedvirtual |
Creates a StyleOptionGanttItem with all style options filled in except the target rectangles.
Definition at line 113 of file kdganttlegend.cpp.
References d, KDGantt::StyleOptionGanttItem::displayPosition, KDGantt::LegendRole, KDGantt::StyleOptionGanttItem::Right, and KDGantt::StyleOptionGanttItem::text.
Referenced by drawItem().
|
inlineoverrideprotected |
Definition at line 47 of file kdganttlegend.h.
|
override |
Definition at line 49 of file kdganttlegend.cpp.
|
inlineoverrideprotected |
Definition at line 51 of file kdganttlegend.h.
|
protectedvirtual |
Calculates the needed space for the legend item at index and, if recursive is true, all child items.
Definition at line 167 of file kdganttlegend.cpp.
References d, and KDGantt::LegendRole.
Referenced by drawItem(), minimumSizeHint(), and sizeHint().
|
override |
Definition at line 66 of file kdganttlegend.cpp.
References measureItem().
|
protectedvirtualslot |
Triggers repainting of the legend.
Definition at line 92 of file kdganttlegend.cpp.
Referenced by setModel().
|
inlineoverrideprotected |
Definition at line 55 of file kdganttlegend.h.
|
overrideprotected |
Definition at line 98 of file kdganttlegend.cpp.
References drawItem().
|
inlineoverride |
Definition at line 31 of file kdganttlegend.h.
|
override |
Definition at line 71 of file kdganttlegend.cpp.
References d, and modelDataChanged().
|
inlineoverrideprotected |
Definition at line 59 of file kdganttlegend.h.
|
override |
Definition at line 61 of file kdganttlegend.cpp.
References measureItem().
|
inlineoverrideprotected |
Definition at line 62 of file kdganttlegend.h.
|
override |
Definition at line 55 of file kdganttlegend.cpp.
|
inlineoverrideprotected |
Definition at line 66 of file kdganttlegend.h.