kdgantt
KDGantt::GraphicsView Class Reference
The GraphicsView class provides a model/view implementation of a gantt chart. More...
#include <KDGanttGraphicsView>

Public Slots | |
| void | setConstraintModel (ConstraintModel *) |
| void | setGrid (AbstractGrid *) |
| void | setItemDelegate (ItemDelegate *delegate) |
| void | setModel (QAbstractItemModel *) |
| void | setReadOnly (bool) |
| void | setRootIndex (const QModelIndex &) |
| void | setRowController (AbstractRowController *) |
| void | setSelectionModel (QItemSelectionModel *) |
| void | setSummaryHandlingModel (QAbstractProxyModel *model) |
Signals | |
| void | activated (const QModelIndex &index) |
| void | clicked (const QModelIndex &index) |
| void | doubleClicked (const QModelIndex &index) |
| void | entered (const QModelIndex &index) |
| void | pressed (const QModelIndex &index) |
Public Member Functions | |
| GraphicsView (QWidget *parent=0) | |
| virtual | ~GraphicsView () |
| virtual void | addConstraint (const QModelIndex &from, const QModelIndex &to, Qt::KeyboardModifiers modifiers) |
| void | clearItems () |
| ConstraintModel * | constraintModel () const |
| void | deleteSubtree (const QModelIndex &) |
| AbstractGrid * | grid () const |
| qreal | headerHeight () const |
| QModelIndex | indexAt (const QPoint &pos) const |
| bool | isReadOnly () const |
| ItemDelegate * | itemDelegate () const |
| QAbstractItemModel * | model () const |
| void | print (QPainter *painter, const QRectF &target=QRectF(), const QRectF &source=QRectF(), bool drawRowLabels=true, bool drawHeader=true) |
| QRectF | printRect (bool drawRowLabels=true) |
| void | renderHeader (QPainter *painter, const QRectF &target, const QRectF &source, Qt::AspectRatioMode aspectRatioMode=Qt::KeepAspectRatio) |
| QModelIndex | rootIndex () const |
| AbstractRowController * | rowController () const |
| QItemSelectionModel * | selectionModel () const |
| QAbstractProxyModel * | summaryHandlingModel () const |
| void | updateRow (const QModelIndex &) |
| void | updateScene () |
| void | updateSceneRect () |
Protected Member Functions | |
| void | resizeEvent (QResizeEvent *) |
Properties | |
| bool | readOnly |
Detailed Description
The GraphicsView class provides a model/view implementation of a gantt chart.
Definition at line 42 of file kdganttgraphicsview.h.
Constructor & Destructor Documentation
| GraphicsView::GraphicsView | ( | QWidget * | parent = 0 |
) | [explicit] |
Constructor. Creates a new KDGantt::GraphicsView with parent parent.
Definition at line 354 of file kdganttgraphicsview.cpp.
| GraphicsView::~GraphicsView | ( | ) | [virtual] |
Destroys this view.
Definition at line 380 of file kdganttgraphicsview.cpp.
Member Function Documentation
| void KDGantt::GraphicsView::activated | ( | const QModelIndex & | index | ) | [signal] |
| void GraphicsView::addConstraint | ( | const QModelIndex & | from, | |
| const QModelIndex & | to, | |||
| Qt::KeyboardModifiers | modifiers | |||
| ) | [virtual] |
Adds a constraint from to to. modifiers are the keyboard modifiers pressed by the user when the action is invoked.
Override this to control how contraints are added. The default implementation adds a soft constraint unless the Shift key is pressed, in that case it adds a hard constraint. If a constraint is already present, it is removed and nothing is added.
Definition at line 562 of file kdganttgraphicsview.cpp.
| void GraphicsView::clearItems | ( | ) |
| void KDGantt::GraphicsView::clicked | ( | const QModelIndex & | index | ) | [signal] |
| ConstraintModel * GraphicsView::constraintModel | ( | ) | const |
- Returns:
- the KDGantt::ConstraintModel displayed by this view.
Definition at line 451 of file kdganttgraphicsview.cpp.
| void GraphicsView::deleteSubtree | ( | const QModelIndex & | idx | ) |
| void KDGantt::GraphicsView::doubleClicked | ( | const QModelIndex & | index | ) | [signal] |
| void KDGantt::GraphicsView::entered | ( | const QModelIndex & | index | ) | [signal] |
| AbstractGrid * GraphicsView::grid | ( | ) | const |
- Returns:
- the AbstractGrid used by this view.
Definition at line 534 of file kdganttgraphicsview.cpp.
| qreal GraphicsView::headerHeight | ( | ) | const |
Definition at line 687 of file kdganttgraphicsview.cpp.
| QModelIndex GraphicsView::indexAt | ( | const QPoint & | pos | ) | const |
- Returns:
- The QModelIndex for the item located at position pos in the view or an invalid index if no item was present at that position.
This is useful for for example contextmenus.
Definition at line 600 of file kdganttgraphicsview.cpp.
| bool GraphicsView::isReadOnly | ( | ) | const |
- Returns:
- true iff the view is in read-only mode
Definition at line 549 of file kdganttgraphicsview.cpp.
| ItemDelegate * GraphicsView::itemDelegate | ( | ) | const |
- Returns:
- the ItemDelegate used by this view to render items
Definition at line 496 of file kdganttgraphicsview.cpp.
| QAbstractItemModel * GraphicsView::model | ( | ) | const |
- Returns:
- the current model displayed by this view
Definition at line 408 of file kdganttgraphicsview.cpp.
| void KDGantt::GraphicsView::pressed | ( | const QModelIndex & | index | ) | [signal] |
| void GraphicsView::print | ( | QPainter * | painter, | |
| const QRectF & | target = QRectF(), |
|||
| const QRectF & | source = QRectF(), |
|||
| bool | drawRowLabels = true, |
|||
| bool | drawHeader = true | |||
| ) |
Render the GanttView inside the rectangle target using the painter painter. This is useful for printing. If target is a null rect, the dimensions of painter's paint device will be used. If drawRowLabels is true, an additional per-row label is drawn, mimicing the look of a listview.
Definition at line 673 of file kdganttgraphicsview.cpp.
| QRectF GraphicsView::printRect | ( | bool | drawRowLabels = true |
) |
Definition at line 677 of file kdganttgraphicsview.cpp.
| void GraphicsView::renderHeader | ( | QPainter * | painter, | |
| const QRectF & | target, | |||
| const QRectF & | source, | |||
| Qt::AspectRatioMode | aspectRatioMode = Qt::KeepAspectRatio | |||
| ) |
Definition at line 682 of file kdganttgraphicsview.cpp.
| void GraphicsView::resizeEvent | ( | QResizeEvent * | ev | ) | [protected] |
Definition at line 574 of file kdganttgraphicsview.cpp.
| QModelIndex GraphicsView::rootIndex | ( | ) | const |
- Returns:
- the rootindex for this view.
Definition at line 466 of file kdganttgraphicsview.cpp.
| AbstractRowController * GraphicsView::rowController | ( | ) | const |
- Returns:
- the AbstractRowController for this view.
- See also:
- setRowController
Definition at line 516 of file kdganttgraphicsview.cpp.
| QItemSelectionModel * GraphicsView::selectionModel | ( | ) | const |
- Returns:
- the QItemSelectionModel used by this view
Definition at line 481 of file kdganttgraphicsview.cpp.
| void GraphicsView::setConstraintModel | ( | ConstraintModel * | cmodel | ) | [slot] |
Sets the constraintmodel displayed by this view.
- See also:
- KDGantt::ConstraintModel.
Definition at line 444 of file kdganttgraphicsview.cpp.
| void GraphicsView::setGrid | ( | AbstractGrid * | grid | ) | [slot] |
Sets the AbstractGrid for this view. The grid is an object that controls how QModelIndexes are mapped to and from the view and how the background and header is rendered.
- See also:
- AbstractGrid and DateTimeGrid.
Definition at line 526 of file kdganttgraphicsview.cpp.
| void GraphicsView::setItemDelegate | ( | ItemDelegate * | delegate | ) | [slot] |
Sets the KDGantt::ItemDelegate used for rendering items on this view.
- See also:
- ItemDelegate and QAbstractItemDelegate.
Definition at line 489 of file kdganttgraphicsview.cpp.
| void GraphicsView::setModel | ( | QAbstractItemModel * | model | ) | [slot] |
Sets the model to be displayed in this view to model. The view does not take ownership of the model.
To make a model work well with GraphicsView it must have a certain layout. Whether the model is flat or has a treestrucure is not important, as long as an AbstractRowController is provided that can navigate the model.
GraphicsView operates per row in the model. The data is always taken from the _last_ item in the row. The ItemRoles used are Qt::DisplayRole and the roles defined in KDGantt::ItemDataRole.
Definition at line 400 of file kdganttgraphicsview.cpp.
| void GraphicsView::setReadOnly | ( | bool | ro | ) | [slot] |
Sets the view to read-only mode if to is true. The default is read/write if the model permits it.
Definition at line 542 of file kdganttgraphicsview.cpp.
| void GraphicsView::setRootIndex | ( | const QModelIndex & | idx | ) | [slot] |
Sets the root index of the model displayed by this view. Similar to QAbstractItemView::setRootIndex, default is QModelIndex().
Definition at line 459 of file kdganttgraphicsview.cpp.
| void GraphicsView::setRowController | ( | AbstractRowController * | rowcontroller | ) | [slot] |
Sets the AbstractRowController used by this view. The AbstractRowController deals with the height and position of each row and with which parts of the model are displayed.
- See also:
- AbstractRowController
Definition at line 506 of file kdganttgraphicsview.cpp.
| void GraphicsView::setSelectionModel | ( | QItemSelectionModel * | model | ) | [slot] |
Sets the QItemSelectionModel used by this view to manage selections. Similar to QAbstractItemView::setSelectionModel
Definition at line 474 of file kdganttgraphicsview.cpp.
| void GraphicsView::setSummaryHandlingModel | ( | QAbstractProxyModel * | model | ) | [slot] |
Definition at line 413 of file kdganttgraphicsview.cpp.
| QAbstractProxyModel* KDGantt::GraphicsView::summaryHandlingModel | ( | ) | const |
| void GraphicsView::updateRow | ( | const QModelIndex & | idx | ) |
| void GraphicsView::updateScene | ( | ) |
For internal use only.
Resets the state of the view.
Definition at line 641 of file kdganttgraphicsview.cpp.
| void GraphicsView::updateSceneRect | ( | ) |
For internal use only.
Adjusts the bounding rectangle of the scene.
Definition at line 625 of file kdganttgraphicsview.cpp.
Property Documentation
bool KDGantt::GraphicsView::readOnly [read, write] |
Definition at line 46 of file kdganttgraphicsview.h.
The documentation for this class was generated from the following files:
KDE 4.4 API Reference