Public Slots | Public Member Functions | Protected Member Functions

KDGantt::View Class Reference

This widget that consists of a QTreeView and a GraphicsView. More...

#include <KDGanttView>

Inheritance diagram for KDGantt::View:
Inheritance graph
[legend]
Collaboration diagram for KDGantt::View:
Collaboration graph
[legend]

List of all members.

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

ConstraintModelconstraintModel () const
void ensureVisible (const QModelIndex &index)
const QAbstractProxyModelganttProxyModel () const
QAbstractProxyModelganttProxyModel ()
GraphicsViewgraphicsView ()
const GraphicsViewgraphicsView () const
AbstractGridgrid () const
QModelIndex indexAt (const QPoint &pos) const
ItemDelegateitemDelegate () const
const QAbstractItemViewleftView () const
QAbstractItemViewleftView ()
QAbstractItemModel * model () const
void print (QPainter *painter, const QRectF &target=QRectF(), bool drawRowLabels=true)
void print (QPrinter *printer, bool drawRowLabels=true)
void print (QPrinter *printer, qreal start, qreal end, bool drawRowLabels=true)
void print (QPainter *painter, qreal start, qreal end, const QRectF &target=QRectF(), bool drawRowLabels=true)
QModelIndex rootIndex () const
AbstractRowControllerrowController ()
const AbstractRowControllerrowController () const
QItemSelectionModel * selectionModel () const
void setLeftView (QAbstractItemView *)
void setRowController (AbstractRowController *)
QSplitter * splitter ()
const QSplitter * splitter () const
 View (QWidget *parent=0)
virtual ~View ()

Protected Member Functions

void resizeEvent (QResizeEvent *)

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 KDGantt::GraphicsView on the right separated by a QSplitter. The two views share the same model.

Definition at line 45 of file kdganttview.h.


Constructor & Destructor Documentation

View::View ( QWidget parent = 0  )  [explicit]

Constructor. Creates a View with parent parent, a DateTimeGrid as default grid implementaion and no model etc.

Definition at line 239 of file kdganttview.cpp.

View::~View (  )  [virtual]

Definition at line 249 of file kdganttview.cpp.


Member Function Documentation

void View::collapseAll ( QModelIndex  index = QModelIndex()  )  [slot]

Definition at line 420 of file kdganttview.cpp.

References leftView().

ConstraintModel * View::constraintModel (  )  const
Returns:
the KDGantt::ConstraintModel displayed by this view.

Definition at line 476 of file kdganttview.cpp.

References d.

void View::ensureVisible ( const QModelIndex &  index  ) 
void View::expandAll ( QModelIndex  index = QModelIndex()  )  [slot]

Definition at line 414 of file kdganttview.cpp.

References leftView().

QAbstractProxyModel * View::ganttProxyModel (  ) 

Definition at line 486 of file kdganttview.cpp.

References d.

const QAbstractProxyModel * View::ganttProxyModel (  )  const

Definition at line 481 of file kdganttview.cpp.

References d.

Referenced by KDAB_SCOPED_UNITTEST_SIMPLE().

const GraphicsView * KDGantt::View::graphicsView (  )  const
Returns:
a pointer to the GraphicsView

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 339 of file kdganttview.cpp.

References d.

Referenced by ensureVisible(), and print().

GraphicsView * View::graphicsView (  ) 

Definition at line 347 of file kdganttview.cpp.

References d.

AbstractGrid * View::grid (  )  const
Returns:
the AbstractGrid used by this view.

Definition at line 428 of file kdganttview.cpp.

References d.

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 517 of file kdganttview.cpp.

References d.

ItemDelegate * View::itemDelegate (  )  const
Returns:
the ItemDelegate used by this view to render items

Definition at line 451 of file kdganttview.cpp.

References d.

const QAbstractItemView * KDGantt::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 323 of file kdganttview.cpp.

References d.

Referenced by collapseAll(), expandAll(), model(), rootIndex(), selectionModel(), setItemDelegate(), setModel(), setRootIndex(), and setSelectionModel().

QAbstractItemView * View::leftView (  ) 

Definition at line 331 of file kdganttview.cpp.

References d.

QAbstractItemModel * View::model (  )  const
Returns:
the current model displayed by this view

Definition at line 371 of file kdganttview.cpp.

References leftView().

void View::print ( QPainter *  painter,
const QRectF &  target = QRectF(),
bool  drawRowLabels = 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.

Definition at line 552 of file kdganttview.cpp.

References d.

void View::print ( QPrinter *  printer,
bool  drawRowLabels = 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.

This version of print() will print multiple pages.

Definition at line 528 of file kdganttview.cpp.

References graphicsView(), and KDGantt::GraphicsView::print().

void View::print ( QPrinter *  printer,
qreal  start,
qreal  end,
bool  drawRowLabels = 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.

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 543 of file kdganttview.cpp.

References graphicsView(), and KDGantt::GraphicsView::print().

void View::print ( QPainter *  painter,
qreal  start,
qreal  end,
const QRectF &  target = QRectF(),
bool  drawRowLabels = 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.

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 567 of file kdganttview.cpp.

References d.

void View::resizeEvent ( QResizeEvent *  ev  )  [protected]

Definition at line 506 of file kdganttview.cpp.

QModelIndex View::rootIndex (  )  const
Returns:
the rootindex for this view.

Definition at line 435 of file kdganttview.cpp.

References leftView().

const AbstractRowController * View::rowController (  )  const

Definition at line 314 of file kdganttview.cpp.

References d.

AbstractRowController * KDGantt::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 307 of file kdganttview.cpp.

References d.

QItemSelectionModel * View::selectionModel (  )  const
Returns:
the QItemSelectionModel used by this view

Definition at line 390 of file kdganttview.cpp.

References leftView().

void View::setConstraintModel ( ConstraintModel cm  )  [slot]

Sets the constraintmodel displayed by this view.

See also:
KDGantt::ConstraintModel.

Definition at line 468 of file kdganttview.cpp.

References d.

void View::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 409 of file kdganttview.cpp.

References d.

void View::setItemDelegate ( ItemDelegate delegate  )  [slot]

Sets the KDGantt::ItemDelegate used for rendering items on this view.

See also:
ItemDelegate and QAbstractItemDelegate.

Definition at line 459 of file kdganttview.cpp.

References d, and leftView().

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 261 of file kdganttview.cpp.

References d.

Referenced by KDAB_SCOPED_UNITTEST_SIMPLE().

void View::setModel ( QAbstractItemModel *  model  )  [slot]

Sets the QAbstractItemModel to be displayed in this view to model.

See also:
GraphicsView::setModel

Definition at line 381 of file kdganttview.cpp.

References d, and leftView().

void View::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 443 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 297 of file kdganttview.cpp.

References d.

Referenced by KDAB_SCOPED_UNITTEST_SIMPLE().

void View::setSelectionModel ( QItemSelectionModel *  smodel  )  [slot]

Sets the QItemSelectionModel used by this view to manage selections. Similar to QAbstractItemView::setSelectionModel

Definition at line 398 of file kdganttview.cpp.

References d, and leftView().

QSplitter * View::splitter (  ) 

Definition at line 363 of file kdganttview.cpp.

References d.

const QSplitter * KDGantt::View::splitter (  )  const
Returns:
a pointer to the QSplitter that manages the left view and graphicsView

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 355 of file kdganttview.cpp.

References d.


The documentation for this class was generated from the following files: