KGantt::View
#include <KGanttView>
Public Slots | |
void | collapseAll (QModelIndex index=QModelIndex()) |
void | expandAll (QModelIndex index=QModelIndex()) |
void | setConstraintModel (KGantt::ConstraintModel *) |
void | setGrid (KGantt::AbstractGrid *) |
void | setItemDelegate (KGantt::ItemDelegate *) |
void | setModel (QAbstractItemModel *model) |
void | setRootIndex (const QModelIndex &idx) |
void | setSelectionModel (QItemSelectionModel *smodel) |
Detailed Description
This widget that consists of a QTreeView and a GraphicsView.
This is the easy to use, complete gantt chart widget. It consists of a QTreeView on the left and a KGantt::GraphicsView on the right separated by a QSplitter. The two views share the same model.
Definition at line 44 of file kganttview.h.
Constructor & Destructor Documentation
◆ View()
Constructor. Creates a View with parent parent, a DateTimeGrid as default grid implementation and no model etc.
Definition at line 230 of file kganttview.cpp.
◆ ~View()
|
override |
Definition at line 240 of file kganttview.cpp.
Member Function Documentation
◆ collapseAll
|
slot |
Definition at line 394 of file kganttview.cpp.
◆ constraintModel()
ConstraintModel * View::constraintModel | ( | ) | const |
- Returns
- the KGantt::ConstraintModel displayed by this view.
Definition at line 445 of file kganttview.cpp.
◆ ensureVisible()
void View::ensureVisible | ( | const QModelIndex & | index | ) |
Definition at line 460 of file kganttview.cpp.
◆ expandAll
|
slot |
Definition at line 383 of file kganttview.cpp.
◆ ganttProxyModel() [1/2]
QAbstractProxyModel * View::ganttProxyModel | ( | ) |
Definition at line 455 of file kganttview.cpp.
◆ ganttProxyModel() [2/2]
const QAbstractProxyModel * View::ganttProxyModel | ( | ) | const |
Definition at line 450 of file kganttview.cpp.
◆ graphicsView() [1/2]
GraphicsView * View::graphicsView | ( | ) |
- Returns
- a pointer to the GraphicsView
Definition at line 332 of file kganttview.cpp.
◆ graphicsView() [2/2]
const GraphicsView * View::graphicsView | ( | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 326 of file kganttview.cpp.
◆ grid()
AbstractGrid * View::grid | ( | ) | const |
- Returns
- the AbstractGrid used by this view.
Definition at line 406 of file kganttview.cpp.
◆ indexAt()
QModelIndex View::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.
- See also
- GraphicsView::indexAt
Definition at line 481 of file kganttview.cpp.
◆ itemDelegate()
ItemDelegate * View::itemDelegate | ( | ) | const |
- Returns
- the ItemDelegate used by this view to render items
Definition at line 425 of file kganttview.cpp.
◆ leftView() [1/2]
QAbstractItemView * View::leftView | ( | ) |
Definition at line 306 of file kganttview.cpp.
◆ leftView() [2/2]
const QAbstractItemView * View::leftView | ( | ) | const |
- Returns
- a pointer to the QAbstractItemView in the left part of the widget.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 300 of file kganttview.cpp.
◆ model()
QAbstractItemModel * View::model | ( | ) | const |
- Returns
- the current model displayed by this view
Definition at line 351 of file kganttview.cpp.
◆ print() [1/4]
void View::print | ( | QPainter * | painter, |
const QRectF & | target = QRectF(), | ||
bool | drawRowLabels = true, | ||
bool | drawColumnLabels = true ) |
Render the GanttView inside the rectangle target using the painter painter. If drawRowLabels is true (the default), each row will have it's label printed on the left side. If drawColumnLabels is true (the default), each column will have it's label printed at the top side.
Definition at line 499 of file kganttview.cpp.
◆ print() [2/4]
void View::print | ( | QPainter * | painter, |
qreal | start, | ||
qreal | end, | ||
const QRectF & | target = QRectF(), | ||
bool | drawRowLabels = true, | ||
bool | drawColumnLabels = true ) |
Render the GanttView inside the rectangle target using the painter painter. If drawRowLabels is true (the default), each row will have it's label printed on the left side. If drawColumnLabels is true (the default), each column will have it's label printed at the top side.
To print a certain range of a chart with a DateTimeGrid, use qreal DateTimeGrid::mapFromDateTime( const QDateTime& dt) const to figure out the values for start and end.
Definition at line 508 of file kganttview.cpp.
◆ print() [3/4]
Print the Gantt chart using printer. If drawRowLabels is true (the default), each row will have it's label printed on the left side. If drawColumnLabels is true (the default), each column will have it's label printed at the top side.
This version of print() will print multiple pages.
Definition at line 487 of file kganttview.cpp.
◆ print() [4/4]
void View::print | ( | QPrinter * | printer, |
qreal | start, | ||
qreal | end, | ||
bool | drawRowLabels = true, | ||
bool | drawColumnLabels = true ) |
Print part of the Gantt chart from start to end using printer. If drawRowLabels is true (the default), each row will have it's label printed on the left side. If drawColumnLabels is true (the default), each column will have it's label printed at the top side.
This version of print() will print multiple pages.
To print a certain range of a chart with a DateTimeGrid, use qreal DateTimeGrid::mapFromDateTime( const QDateTime& dt) const to figure out the values for start and end.
Definition at line 493 of file kganttview.cpp.
◆ printDiagram()
void View::printDiagram | ( | QPrinter * | printer, |
const PrintingContext & | context = PrintingContext() ) |
Print the Gantt chart on the printer in accordance with the PrintingContext context
- See also
- PrintingContext
- Since
- 2.8.0
Definition at line 517 of file kganttview.cpp.
◆ resizeEvent()
|
overrideprotectedvirtual |
Reimplemented from QWidget.
◆ rootIndex()
QModelIndex View::rootIndex | ( | ) | const |
- Returns
- the rootindex for this view.
Definition at line 412 of file kganttview.cpp.
◆ rowController() [1/2]
AbstractRowController * View::rowController | ( | ) |
- Returns
- a pointer to the current rowcontroller.
- See also
- AbstractRowController
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 288 of file kganttview.cpp.
◆ rowController() [2/2]
const AbstractRowController * View::rowController | ( | ) | const |
Definition at line 294 of file kganttview.cpp.
◆ selectionModel()
QItemSelectionModel * View::selectionModel | ( | ) | const |
- Returns
- the QItemSelectionModel used by this view
Definition at line 365 of file kganttview.cpp.
◆ setConstraintModel
|
slot |
Sets the constraintmodel displayed by this view.
- See also
- KGantt::ConstraintModel.
Definition at line 438 of file kganttview.cpp.
◆ setGraphicsView()
void View::setGraphicsView | ( | GraphicsView * | gv | ) |
Set the GraphicsView to be used for this View. It only makes sense to call this if you need to subclass GraphicsView.
NOTE: Only call this right after creating the View, before setting a model or any other attributes.
Definition at line 312 of file kganttview.cpp.
◆ setGrid
|
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 378 of file kganttview.cpp.
◆ setItemDelegate
|
slot |
Sets the KGantt::ItemDelegate used for rendering items on this view.
- See also
- ItemDelegate and QAbstractItemDelegate.
Definition at line 431 of file kganttview.cpp.
◆ setLeftView()
void View::setLeftView | ( | QAbstractItemView * | aiv | ) |
Replaces the left widget with a custom QAbstractItemView.
- Parameters
-
aiv The view to be used to the left, instead of the default tree view
- See also
- setRowController()
Definition at line 248 of file kganttview.cpp.
◆ setModel
|
slot |
Sets the QAbstractItemModel to be displayed in this view to model.
- See also
- GraphicsView::setModel
Definition at line 357 of file kganttview.cpp.
◆ setRootIndex
|
slot |
Sets the root index of the model displayed by this view. Similar to QAbstractItemView::setRootIndex, default is QModelIndex().
Definition at line 418 of file kganttview.cpp.
◆ setRowController()
void View::setRowController | ( | AbstractRowController * | ctrl | ) |
Sets ctrl to be the rowcontroller used by this View. The default rowcontroller is owned by KGantt::View and is suitable for the default treeview in the left part of the view. You probably only want to change this if you replace the treeview.
Definition at line 280 of file kganttview.cpp.
◆ setSelectionModel
|
slot |
Sets the QItemSelectionModel used by this view to manage selections. Similar to QAbstractItemView::setSelectionModel
Definition at line 371 of file kganttview.cpp.
◆ splitter() [1/2]
QSplitter * View::splitter | ( | ) |
- Returns
- a pointer to the QSplitter that manages the left view and graphicsView
Definition at line 344 of file kganttview.cpp.
◆ splitter() [2/2]
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 338 of file kganttview.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:14:21 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.