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

kdgantt

KDGantt::DateTimeGrid

KDGantt::DateTimeGrid Class Reference

#include <kdganttdatetimegrid.h>

Inheritance diagram for KDGantt::DateTimeGrid:

Inheritance graph
[legend]

List of all members.


Detailed Description

This implementation of AbstractGrid works with QDateTime and shows days and week numbers in the header

Todo:
Extend to work with hours, minutes,... as units too.

Definition at line 34 of file kdganttdatetimegrid.h.


Public Types

enum  Scale { ScaleAuto, ScaleHour, ScaleDay, ScaleWeek }

Public Member Functions

 DateTimeGrid ()
qreal dayWidth () const
QSet< Qt::DayOfWeek > freeDays () const
bool mapFromChart (const Span &span, const QModelIndex &idx, const QList< Constraint > &constraints=QList< Constraint >()) const
Span mapToChart (const QModelIndex &idx) const
void paintGrid (QPainter *painter, const QRectF &sceneRect, const QRectF &exposedRect, AbstractRowController *rowController=0, QWidget *widget=0)
void paintHeader (QPainter *painter, const QRectF &headerRect, const QRectF &exposedRect, qreal offset, QWidget *widget=0)
bool rowSeparators () const
Scale scale () const
void setDayWidth (qreal)
void setFreeDays (const QSet< Qt::DayOfWeek > &fd)
void setRowSeparators (bool enable)
void setScale (Scale s)
void setStartDateTime (const QDateTime &dt)
void setWeekStart (Qt::DayOfWeek)
QDateTime startDateTime () const
Qt::DayOfWeek weekStart () const
virtual ~DateTimeGrid ()

Protected Member Functions

virtual void paintDayScaleHeader (QPainter *painter, const QRectF &headerRect, const QRectF &exposedRect, qreal offset, QWidget *widget=0)
virtual void paintHourScaleHeader (QPainter *painter, const QRectF &headerRect, const QRectF &exposedRect, qreal offset, QWidget *widget=0)
virtual void paintWeekScaleHeader (QPainter *painter, const QRectF &headerRect, const QRectF &exposedRect, qreal offset, QWidget *widget=0)

Member Enumeration Documentation

enum KDGantt::DateTimeGrid::Scale

Enumerator:
ScaleAuto 
ScaleHour 
ScaleDay 
ScaleWeek 

Definition at line 38 of file kdganttdatetimegrid.h.


Constructor & Destructor Documentation

DateTimeGrid::DateTimeGrid (  ) 

Definition at line 78 of file kdganttdatetimegrid.cpp.

DateTimeGrid::~DateTimeGrid (  )  [virtual]

Definition at line 82 of file kdganttdatetimegrid.cpp.


Member Function Documentation

qreal DateTimeGrid::dayWidth (  )  const

Returns:
The width in pixels for each day in the grid.
The default is 100 pixels.

Definition at line 110 of file kdganttdatetimegrid.cpp.

QSet< Qt::DayOfWeek > DateTimeGrid::freeDays (  )  const

Returns:
The days marked as free in the grid.

Definition at line 179 of file kdganttdatetimegrid.cpp.

bool DateTimeGrid::mapFromChart ( const Span &  span,
const QModelIndex &  idx,
const QList< Constraint > &  constraints = QList<Constraint>() 
) const [virtual]

Maps the supplied Span to QDateTimes, and puts them as start time and end time for the supplied index.

Parameters:
span The span used to map from.
idx The index used for setting the start time and end time in the model.
constraints A list of hard constraints to match against the start time and end time mapped from the span.
Returns:
true if the start time and time was successfully added to the model, or false if unsucessful. Also returns false if any of the constraints isn't satisfied. That is, if the start time of the constrained index is before the end time of the dependency index, or the end time of the constrained index is before the start time of the dependency index.

Implements KDGantt::AbstractGrid.

Definition at line 257 of file kdganttdatetimegrid.cpp.

Span DateTimeGrid::mapToChart ( const QModelIndex &  idx  )  const [virtual]

Parameters:
idx The index to get the Span for.
Returns:
The start and end pixels, in a Span, of the specified index.

Implements KDGantt::AbstractGrid.

Definition at line 198 of file kdganttdatetimegrid.cpp.

void DateTimeGrid::paintDayScaleHeader ( QPainter *  painter,
const QRectF &  headerRect,
const QRectF &  exposedRect,
qreal  offset,
QWidget *  widget = 0 
) [protected, virtual]

Paints the day scale header.

See also:
paintHeader()

Definition at line 386 of file kdganttdatetimegrid.cpp.

void DateTimeGrid::paintGrid ( QPainter *  painter,
const QRectF &  sceneRect,
const QRectF &  exposedRect,
AbstractRowController *  rowController = 0,
QWidget *  widget = 0 
) [virtual]

Implement this to paint the background of the view -- typically with some grid lines.

Parameters:
painter -- the QPainter to paint with.
sceneRect -- the total bounding rectangle of the scene.
exposedRect -- the rectangle that needs to be painted.
rowController -- the row controller used by the view -- may be 0.
widget -- the widget used by the view -- may be 0.

Implements KDGantt::AbstractGrid.

Definition at line 283 of file kdganttdatetimegrid.cpp.

void DateTimeGrid::paintHeader ( QPainter *  painter,
const QRectF &  headerRect,
const QRectF &  exposedRect,
qreal  offset,
QWidget *  widget = 0 
) [virtual]

Implement this to paint the header part of the view.

Parameters:
painter -- the QPainter to paint with.
headerRect -- the total rectangle occupied by the header.
exposedRect -- the rectangle that needs to be painted.
offset -- the horizontal scroll offset of the view.
widget -- the widget used by the view -- may be 0.

Implements KDGantt::AbstractGrid.

Definition at line 329 of file kdganttdatetimegrid.cpp.

void DateTimeGrid::paintHourScaleHeader ( QPainter *  painter,
const QRectF &  headerRect,
const QRectF &  exposedRect,
qreal  offset,
QWidget *  widget = 0 
) [protected, virtual]

Paints the hour scale header.

See also:
paintHeader()

Definition at line 351 of file kdganttdatetimegrid.cpp.

void DateTimeGrid::paintWeekScaleHeader ( QPainter *  painter,
const QRectF &  headerRect,
const QRectF &  exposedRect,
qreal  offset,
QWidget *  widget = 0 
) [protected, virtual]

Paints the week scale header.

See also:
paintHeader()

Definition at line 424 of file kdganttdatetimegrid.cpp.

bool DateTimeGrid::rowSeparators (  )  const

Returns:
true if row separators are used.

Definition at line 185 of file kdganttdatetimegrid.cpp.

DateTimeGrid::Scale DateTimeGrid::scale (  )  const

Returns:
The scale used to paint the grid.
The default is ScaleAuto, which means the day scale will be used as long as the day width is less or equal to 500.
See also:
Scale

Definition at line 144 of file kdganttdatetimegrid.cpp.

void DateTimeGrid::setDayWidth ( qreal  w  ) 

Parameters:
w The width in pixels for each day in the grid. Day width is limited to minimum 1.0.
The signal gridChanged() is emitted after the day width is changed.

Definition at line 120 of file kdganttdatetimegrid.cpp.

void DateTimeGrid::setFreeDays ( const QSet< Qt::DayOfWeek > &  fd  ) 

Parameters:
fd A set of days to mark as free in the grid.
Free days are filled with the alternate base brush of the palette used by the view. The signal gridChanged() is emitted after the free days are changed.

Definition at line 172 of file kdganttdatetimegrid.cpp.

void DateTimeGrid::setRowSeparators ( bool  enable  ) 

Parameters:
enable Whether to use row separators or not.

Definition at line 190 of file kdganttdatetimegrid.cpp.

void DateTimeGrid::setScale ( Scale  s  ) 

Parameters:
s The scale to be used to paint the grid.
The signal gridChanged() is emitted after the scale has changed.
See also:
Scale

Definition at line 132 of file kdganttdatetimegrid.cpp.

void DateTimeGrid::setStartDateTime ( const QDateTime &  dt  ) 

Parameters:
dt The start date of the grid. It is used as the beginning of the horizontal scrollbar in the view.
Emits gridChanged() after the start date has changed.

Definition at line 100 of file kdganttdatetimegrid.cpp.

void DateTimeGrid::setWeekStart ( Qt::DayOfWeek  ws  ) 

Parameters:
ws The start day of the week.
A solid line is drawn on the grid to mark the beginning of a new week. Emits gridChanged() after the start day has changed.

Definition at line 154 of file kdganttdatetimegrid.cpp.

QDateTime DateTimeGrid::startDateTime (  )  const

Returns:
The QDateTime used as start date for the grid.
The default is three days before the current date.

Definition at line 90 of file kdganttdatetimegrid.cpp.

Qt::DayOfWeek DateTimeGrid::weekStart (  )  const

Returns:
The start day of the week

Definition at line 161 of file kdganttdatetimegrid.cpp.


The documentation for this class was generated from the following files:
  • kdganttdatetimegrid.h
  • kdganttdatetimegrid.cpp

kdgantt

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

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  •   doc
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal