kdgantt
KDGantt::GraphicsView Class Reference
#include <KDGanttGraphicsView>

Detailed Description
The GraphicsView class provides a model/view implementation of a gantt chart.Definition at line 42 of file kdganttgraphicsview.h.
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 | |
| 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) |
| Q_PRIVATE_SLOT (d, void slotGridChanged()) Q_PRIVATE_SLOT(d | |
| void | renderHeader (QPainter *painter, const QRectF &target, const QRectF &source, Qt::AspectRatioMode aspectRatioMode=Qt::KeepAspectRatio) |
| QModelIndex | rootIndex () const |
| AbstractRowController * | rowController () const |
| QItemSelectionModel * | selectionModel () const |
| void void | slotColumnsInserted (const QModelIndex &parent, int start, int end)) Q_PRIVATE_SLOT(d |
| void void void | slotColumnsRemoved (const QModelIndex &parent, int start, int end)) Q_PRIVATE_SLOT(d |
| void void void void | slotDataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)) Q_PRIVATE_SLOT(d |
| void | slotHorizontalScrollValueChanged (int)) Q_PRIVATE_SLOT(d |
| void void void void void void void void void void | slotItemClicked (const QModelIndex &idx)) Q_PRIVATE_SLOT(d |
| void void void void void | slotLayoutChanged ()) Q_PRIVATE_SLOT(d |
| void void void void void void | slotModelReset ()) Q_PRIVATE_SLOT(d |
| void void void void void void void void | slotRowsAboutToBeRemoved (const QModelIndex &parent, int start, int end)) Q_PRIVATE_SLOT(d |
| void void void void void void void | slotRowsInserted (const QModelIndex &parent, int start, int end)) Q_PRIVATE_SLOT(d |
| void void void void void void void void void | slotRowsRemoved (const QModelIndex &parent, int start, int end)) Q_PRIVATE_SLOT(d |
| QAbstractProxyModel * | summaryHandlingModel () const |
| void | updateRow (const QModelIndex &) |
| void | updateScene () |
| void | updateSceneRect () |
Protected Member Functions | |
| void | resizeEvent (QResizeEvent *) |
Properties | |
| bool | readOnly |
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 522 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 411 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 |
| qreal GraphicsView::headerHeight | ( | ) | const |
Definition at line 647 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.
Definition at line 560 of file kdganttgraphicsview.cpp.
| bool GraphicsView::isReadOnly | ( | ) | const |
- Returns:
- true iff the view is in read-only mode
Definition at line 509 of file kdganttgraphicsview.cpp.
| ItemDelegate * GraphicsView::itemDelegate | ( | ) | const |
- Returns:
- the ItemDelegate used by this view to render items
Definition at line 456 of file kdganttgraphicsview.cpp.
| QAbstractItemModel * GraphicsView::model | ( | ) | const |
- Returns:
- the current model displayed by this view
Definition at line 368 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 633 of file kdganttgraphicsview.cpp.
| QRectF GraphicsView::printRect | ( | bool | drawRowLabels = true |
) |
Definition at line 637 of file kdganttgraphicsview.cpp.
| KDGantt::GraphicsView::Q_PRIVATE_SLOT | ( | d | , | |
| void | slotGridChanged() | |||
| ) |
| void GraphicsView::renderHeader | ( | QPainter * | painter, | |
| const QRectF & | target, | |||
| const QRectF & | source, | |||
| Qt::AspectRatioMode | aspectRatioMode = Qt::KeepAspectRatio | |||
| ) |
Definition at line 642 of file kdganttgraphicsview.cpp.
| void GraphicsView::resizeEvent | ( | QResizeEvent * | ev | ) | [protected] |
Definition at line 534 of file kdganttgraphicsview.cpp.
| QModelIndex GraphicsView::rootIndex | ( | ) | const |
| AbstractRowController * GraphicsView::rowController | ( | ) | const |
- Returns:
- the AbstractRowController for this view.
- See also:
- setRowController
Definition at line 476 of file kdganttgraphicsview.cpp.
| QItemSelectionModel * GraphicsView::selectionModel | ( | ) | const |
- Returns:
- the QItemSelectionModel used by this view
Definition at line 441 of file kdganttgraphicsview.cpp.
| void GraphicsView::setConstraintModel | ( | ConstraintModel * | cmodel | ) | [slot] |
Sets the constraintmodel displayed by this view.
- See also:
- KDGantt::ConstraintModel.
Definition at line 404 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 486 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 449 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 360 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 502 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 419 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 466 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 434 of file kdganttgraphicsview.cpp.
| void GraphicsView::setSummaryHandlingModel | ( | QAbstractProxyModel * | model | ) | [slot] |
Definition at line 373 of file kdganttgraphicsview.cpp.
| void void KDGantt::GraphicsView::slotColumnsInserted | ( | const QModelIndex & | parent, | |
| int | start, | |||
| int | end | |||
| ) |
| void void void KDGantt::GraphicsView::slotColumnsRemoved | ( | const QModelIndex & | parent, | |
| int | start, | |||
| int | end | |||
| ) |
| void void void void KDGantt::GraphicsView::slotDataChanged | ( | const QModelIndex & | topLeft, | |
| const QModelIndex & | bottomRight | |||
| ) |
| void KDGantt::GraphicsView::slotHorizontalScrollValueChanged | ( | int | ) |
| void void void void void void void void void void KDGantt::GraphicsView::slotItemClicked | ( | const QModelIndex & | idx | ) |
| void void void void void KDGantt::GraphicsView::slotLayoutChanged | ( | ) |
| void void void void void void KDGantt::GraphicsView::slotModelReset | ( | ) |
| void void void void void void void void KDGantt::GraphicsView::slotRowsAboutToBeRemoved | ( | const QModelIndex & | parent, | |
| int | start, | |||
| int | end | |||
| ) |
| void void void void void void void KDGantt::GraphicsView::slotRowsInserted | ( | const QModelIndex & | parent, | |
| int | start, | |||
| int | end | |||
| ) |
| void void void void void void void void void KDGantt::GraphicsView::slotRowsRemoved | ( | const QModelIndex & | parent, | |
| int | start, | |||
| int | end | |||
| ) |
| 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 601 of file kdganttgraphicsview.cpp.
| void GraphicsView::updateSceneRect | ( | ) |
For internal use only.
Adjusts the bounding rectangle of the scene.
Definition at line 585 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.2 API Reference