• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

kdgantt2

  • KDGantt
  • GraphicsView
Classes | Public Slots | Signals | Public Member Functions | Protected Member Functions | Properties | List of all members
KDGantt::GraphicsView Class Reference

#include <KDGanttGraphicsView>

Inheritance diagram for KDGantt::GraphicsView:
Inheritance graph
[legend]

Classes

class  Private
 

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)
 
void updateSceneRect ()
 

Signals

void activated (const QModelIndex &index)
 
void clicked (const QModelIndex &index)
 
void doubleClicked (const QModelIndex &index)
 
void entered (const QModelIndex &index)
 
void headerContextMenuRequested (const QPoint &pt)
 
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
 
Qt::ContextMenuPolicy headerContextMenuPolicy () const
 
QModelIndex indexAt (const QPoint &pos) const
 
bool isReadOnly () const
 
ItemDelegate * itemDelegate () const
 
QAbstractItemModel * model () const
 
void print (QPrinter *printer, bool drawRowLabels=true)
 
void print (QPrinter *printer, qreal start, qreal end, bool drawRowLabels=true)
 
void print (QPainter *painter, const QRectF &target=QRectF(), bool drawRowLabels=true)
 
void print (QPainter *painter, qreal start, qreal end, const QRectF &target=QRectF(), bool drawRowLabels=true)
 
QModelIndex rootIndex () const
 
AbstractRowController * rowController () const
 
QItemSelectionModel * selectionModel () const
 
void setHeaderContextMenuPolicy (Qt::ContextMenuPolicy)
 
QAbstractProxyModel * summaryHandlingModel () const
 
void updateRow (const QModelIndex &)
 
void updateScene ()
 

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 44 of file kdganttgraphicsview.h.

Constructor & Destructor Documentation

GraphicsView::GraphicsView ( QWidget *  parent = 0)
explicit

void GraphicsView::activated( const QModelIndex & index )

void GraphicsView::clicked( const QModelIndex & index );

void GraphicsView::doubleClicked( const QModelIndex & index );

void GraphicsView::entered( const QModelIndex & index );

void GraphicsView::pressed( const QModelIndex & index );

void GraphicsView::headerContextMenuRequested( const QPoint& pt ) This signal is emitted when the header has contextMenuPolicy Qt::CustomContextMenu and the widget wants to show a contextmenu for the header. Unlike in QWidget::customContextMenuRequested() signal, pt is here in global coordinates.

Constructor. Creates a new KDGantt::GraphicsView with parent parent.

Definition at line 304 of file kdganttgraphicsview.cpp.

GraphicsView::~GraphicsView ( )
virtual

Destroys this view.

Definition at line 336 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 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 552 of file kdganttgraphicsview.cpp.

void GraphicsView::clearItems ( )

Definition at line 607 of file kdganttgraphicsview.cpp.

void KDGantt::GraphicsView::clicked ( const QModelIndex &  index)
signal
ConstraintModel * GraphicsView::constraintModel ( ) const
Returns
the KDGantt::ConstraintModel displayed by this view.

Definition at line 413 of file kdganttgraphicsview.cpp.

void GraphicsView::deleteSubtree ( const QModelIndex &  idx)

Definition at line 673 of file kdganttgraphicsview.cpp.

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 503 of file kdganttgraphicsview.cpp.

Qt::ContextMenuPolicy GraphicsView::headerContextMenuPolicy ( ) const
Returns
the context menu policy for the header

Definition at line 539 of file kdganttgraphicsview.cpp.

void KDGantt::GraphicsView::headerContextMenuRequested ( const QPoint &  pt)
signal
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 596 of file kdganttgraphicsview.cpp.

bool GraphicsView::isReadOnly ( ) const
Returns
true iff the view is in read-only mode

Definition at line 518 of file kdganttgraphicsview.cpp.

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

Definition at line 465 of file kdganttgraphicsview.cpp.

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

Definition at line 370 of file kdganttgraphicsview.cpp.

void KDGantt::GraphicsView::pressed ( const QModelIndex &  index)
signal
void GraphicsView::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 684 of file kdganttgraphicsview.cpp.

void GraphicsView::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 699 of file kdganttgraphicsview.cpp.

void GraphicsView::print ( QPainter *  painter,
const QRectF &  targetRect = 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 708 of file kdganttgraphicsview.cpp.

void GraphicsView::print ( QPainter *  painter,
qreal  start,
qreal  end,
const QRectF &  targetRect = 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 721 of file kdganttgraphicsview.cpp.

void GraphicsView::resizeEvent ( QResizeEvent *  ev)
protected

Definition at line 564 of file kdganttgraphicsview.cpp.

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

Definition at line 435 of file kdganttgraphicsview.cpp.

AbstractRowController * GraphicsView::rowController ( ) const
Returns
the AbstractRowController for this view.
See also
setRowController

Definition at line 485 of file kdganttgraphicsview.cpp.

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

Definition at line 450 of file kdganttgraphicsview.cpp.

void GraphicsView::setConstraintModel ( ConstraintModel *  cmodel)
slot

Sets the constraintmodel displayed by this view.

See also
KDGantt::ConstraintModel.

Definition at line 406 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 495 of file kdganttgraphicsview.cpp.

void GraphicsView::setHeaderContextMenuPolicy ( Qt::ContextMenuPolicy  p)

Sets the context menu policy for the header. The default value Qt::DefaultContextMenu results in a standard context menu on the header that allows the user to set the scale and zoom.

Setting this to Qt::CustomContextMenu will cause the signal headerContextMenuRequested(const QPoint& pt) to be emitted instead.

See also
QWidget::setContextMenuPolicy( Qt::ContextMenuPolicy )

Definition at line 532 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 458 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 356 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 511 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 428 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 475 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 443 of file kdganttgraphicsview.cpp.

void GraphicsView::setSummaryHandlingModel ( QAbstractProxyModel *  model)
slot

Definition at line 375 of file kdganttgraphicsview.cpp.

QAbstractProxyModel * GraphicsView::summaryHandlingModel ( ) const
Returns
the KDGantt::SummaryHandlingProxyModel used by this view.

Definition at line 420 of file kdganttgraphicsview.cpp.

void GraphicsView::updateRow ( const QModelIndex &  idx)

Definition at line 613 of file kdganttgraphicsview.cpp.

void GraphicsView::updateScene ( )

Resets the state of the view.

Definition at line 651 of file kdganttgraphicsview.cpp.

void GraphicsView::updateSceneRect ( )
slot

Adjusts the bounding rectangle of the scene.

Definition at line 621 of file kdganttgraphicsview.cpp.

Property Documentation

bool KDGantt::GraphicsView::readOnly
readwrite

Definition at line 48 of file kdganttgraphicsview.h.


The documentation for this class was generated from the following files:
  • kdganttgraphicsview.h
  • kdganttgraphicsview.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:05 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kdgantt2

Skip menu "kdgantt2"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal