KD Chart 2
[rev.2.7]
|
This widget that consists of a QTreeView and a GraphicsView. More...
#include <KDGanttView>
Public Slots | |
void | collapseAll (QModelIndex index=QModelIndex()) |
void | expandAll (QModelIndex index=QModelIndex()) |
void | setConstraintModel (ConstraintModel *) |
void | setGrid (AbstractGrid *) |
void | setItemDelegate (ItemDelegate *) |
void | setModel (QAbstractItemModel *model) |
void | setRootIndex (const QModelIndex &idx) |
void | setSelectionModel (QItemSelectionModel *smodel) |
Public Member Functions | |
ConstraintModel * | constraintModel () const |
void | ensureVisible (const QModelIndex &index) |
const QAbstractProxyModel * | ganttProxyModel () const |
QAbstractProxyModel * | ganttProxyModel () |
const GraphicsView * | graphicsView () const |
GraphicsView * | graphicsView () |
AbstractGrid * | grid () const |
QModelIndex | indexAt (const QPoint &pos) const |
ItemDelegate * | itemDelegate () const |
const QAbstractItemView * | leftView () const |
QAbstractItemView * | leftView () |
QAbstractItemModel * | model () const |
void | print (QPrinter *printer, bool drawRowLabels=true, bool drawColumnLabels=true) |
void | print (QPrinter *printer, qreal start, qreal end, bool drawRowLabels=true, bool drawColumnLabels=true) |
void | print (QPainter *painter, const QRectF &target=QRectF(), bool drawRowLabels=true, bool drawColumnLabels=true) |
void | print (QPainter *painter, qreal start, qreal end, const QRectF &target=QRectF(), bool drawRowLabels=true, bool drawColumnLabels=true) |
QModelIndex | rootIndex () const |
AbstractRowController * | rowController () |
const AbstractRowController * | rowController () const |
QItemSelectionModel * | selectionModel () const |
void | setGraphicsView (GraphicsView *) |
void | setLeftView (QAbstractItemView *) |
void | setRowController (AbstractRowController *) |
const QSplitter * | splitter () const |
QSplitter * | splitter () |
View (QWidget *parent=0) | |
~View () override | |
Protected Member Functions | |
void | resizeEvent (QResizeEvent *) override |
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 KDGantt::GraphicsView on the right separated by a QSplitter. The two views share the same model.
Definition at line 47 of file kdganttview.h.
|
explicit |
Constructor. Creates a View with parent parent, a DateTimeGrid as default grid implementaion and no model etc.
Definition at line 251 of file kdganttview.cpp.
|
override |
Definition at line 261 of file kdganttview.cpp.
|
slot |
Definition at line 449 of file kdganttview.cpp.
References leftView().
ConstraintModel * View::constraintModel | ( | ) | const |
Definition at line 505 of file kdganttview.cpp.
References d.
void View::ensureVisible | ( | const QModelIndex & | index | ) |
Definition at line 520 of file kdganttview.cpp.
References d, KDGantt::GraphicsScene::findItem(), graphicsView(), KDGantt::ForwardingProxyModel::mapFromSource(), and KDGantt::GraphicsScene::summaryHandlingModel().
|
slot |
Definition at line 443 of file kdganttview.cpp.
References leftView().
const QAbstractProxyModel * View::ganttProxyModel | ( | ) | const |
Definition at line 510 of file kdganttview.cpp.
References d.
Referenced by KDAB_SCOPED_UNITTEST_SIMPLE().
QAbstractProxyModel * View::ganttProxyModel | ( | ) |
Definition at line 515 of file kdganttview.cpp.
References d.
const GraphicsView * KDGantt::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 368 of file kdganttview.cpp.
References d.
Referenced by ensureVisible(), and print().
GraphicsView * View::graphicsView | ( | ) |
Definition at line 376 of file kdganttview.cpp.
References d.
AbstractGrid * View::grid | ( | ) | const |
Definition at line 457 of file kdganttview.cpp.
References d.
QModelIndex View::indexAt | ( | const QPoint & | pos | ) | const |
Definition at line 546 of file kdganttview.cpp.
References d.
ItemDelegate * View::itemDelegate | ( | ) | const |
Definition at line 480 of file kdganttview.cpp.
References d.
const QAbstractItemView * KDGantt::View::leftView | ( | ) | 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 335 of file kdganttview.cpp.
References d.
Referenced by collapseAll(), expandAll(), model(), rootIndex(), selectionModel(), setItemDelegate(), setModel(), setRootIndex(), and setSelectionModel().
QAbstractItemView * View::leftView | ( | ) |
Definition at line 343 of file kdganttview.cpp.
References d.
QAbstractItemModel * View::model | ( | ) | const |
Definition at line 400 of file kdganttview.cpp.
References leftView().
void View::print | ( | QPrinter * | printer, |
bool | drawRowLabels = true , |
||
bool | drawColumnLabels = true |
||
) |
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 559 of file kdganttview.cpp.
References graphicsView(), and KDGantt::GraphicsView::print().
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 576 of file kdganttview.cpp.
References graphicsView(), and KDGantt::GraphicsView::print().
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 587 of file kdganttview.cpp.
References d.
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 605 of file kdganttview.cpp.
References d.
|
overrideprotected |
Definition at line 535 of file kdganttview.cpp.
QModelIndex View::rootIndex | ( | ) | const |
Definition at line 464 of file kdganttview.cpp.
References leftView().
AbstractRowController * KDGantt::View::rowController | ( | ) |
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 319 of file kdganttview.cpp.
References d.
const AbstractRowController * View::rowController | ( | ) | const |
Definition at line 326 of file kdganttview.cpp.
References d.
QItemSelectionModel * View::selectionModel | ( | ) | const |
Definition at line 419 of file kdganttview.cpp.
References leftView().
|
slot |
Sets the constraintmodel displayed by this view.
Definition at line 497 of file kdganttview.cpp.
References d.
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 354 of file kdganttview.cpp.
References d, and KDGantt::GraphicsView::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.
Definition at line 438 of file kdganttview.cpp.
References d.
|
slot |
Sets the KDGantt::ItemDelegate used for rendering items on this view.
Definition at line 488 of file kdganttview.cpp.
References d, and leftView().
void View::setLeftView | ( | QAbstractItemView * | aiv | ) |
Replaces the left widget with a custom QAbstractItemView.
aiv | The view to be used to the left, instead of the default tree view |
Definition at line 273 of file kdganttview.cpp.
References d.
Referenced by KDAB_SCOPED_UNITTEST_SIMPLE().
|
slot |
Sets the QAbstractItemModel to be displayed in this view to model.
Definition at line 410 of file kdganttview.cpp.
References d, and leftView().
|
slot |
Sets the root index of the model displayed by this view. Similar to QAbstractItemView::setRootIndex, default is QModelIndex().
Definition at line 472 of file kdganttview.cpp.
References d, and leftView().
void View::setRowController | ( | AbstractRowController * | ctrl | ) |
Sets ctrl to be the rowcontroller used by this View. The default rowcontroller is owned by KDGantt::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 309 of file kdganttview.cpp.
References d.
Referenced by KDAB_SCOPED_UNITTEST_SIMPLE().
|
slot |
Sets the QItemSelectionModel used by this view to manage selections. Similar to QAbstractItemView::setSelectionModel
Definition at line 427 of file kdganttview.cpp.
References d, and leftView().
const QSplitter * KDGantt::View::splitter | ( | ) | 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 384 of file kdganttview.cpp.
References d.
QSplitter * View::splitter | ( | ) |
Definition at line 392 of file kdganttview.cpp.
References d.