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

kdgantt2

  • KDGantt
  • DateTimeScaleFormatter
Classes | Public Types | Public Member Functions | List of all members
KDGantt::DateTimeScaleFormatter Class Reference

#include <kdganttdatetimegrid.h>

Classes

class  Private
 

Public Types

enum  Range {
  Second, Minute, Hour, Day,
  Week, Month, Year
}
 

Public Member Functions

 DateTimeScaleFormatter (Range range, const QString &formatString, Qt::Alignment alignment=Qt::AlignCenter)
 
 DateTimeScaleFormatter (Range range, const QString &formatString, const QString &templ, Qt::Alignment alignment=Qt::AlignCenter)
 
 DateTimeScaleFormatter (const DateTimeScaleFormatter &other)
 
virtual ~DateTimeScaleFormatter ()
 
Qt::Alignment alignment () const
 
virtual QDateTime currentRangeBegin (const QDateTime &datetime) const
 
QString format () const
 
QString format (const QDateTime &datetime) const
 
virtual QDateTime nextRangeBegin (const QDateTime &datetime) const
 
DateTimeScaleFormatter & operator= (const DateTimeScaleFormatter &other)
 
Range range () const
 
virtual QString text (const QDateTime &datetime) const
 

Detailed Description

This class formats dates and times used in DateTimeGrid follawing a given format.

The format follows the format of QDateTime::toString(), with one addition: "w" is replaced with the week number of the date as number without a leading zero (1-53) "ww" is replaced with the week number of the date as number with a leading zero (01-53)

For example:

// formatter to print the complete date over the current week
// This leads to the first day of the week being printed
DateTimeScaleFormatter formatter = DateTimeScaleFormatter( DateTimeScaleFormatter::Week, "yyyy-MM-dd" );

Optionally, you can set an user defined text alignment flag. The default value is Qt::AlignCenter.

See also
DateTimeScaleFormatter::DateTimeScaleFormatter

This class even controls the range of the grid sections.

See also
KDGanttDateTimeScaleFormatter::Range

Definition at line 34 of file kdganttdatetimegrid.h.

Member Enumeration Documentation

enum KDGantt::DateTimeScaleFormatter::Range
Enumerator
Second 
Minute 
Hour 
Day 
Week 
Month 
Year 

Definition at line 38 of file kdganttdatetimegrid.h.

Constructor & Destructor Documentation

DateTimeScaleFormatter::DateTimeScaleFormatter ( Range  range,
const QString &  formatString,
Qt::Alignment  alignment = Qt::AlignCenter 
)

Definition at line 124 of file kdganttdatetimegrid.cpp.

DateTimeScaleFormatter::DateTimeScaleFormatter ( Range  range,
const QString &  format,
const QString &  templ,
Qt::Alignment  alignment = Qt::AlignCenter 
)

Creates a DateTimeScaleFormatter using range and format. The text on the header is aligned following alignment.

Definition at line 118 of file kdganttdatetimegrid.cpp.

DateTimeScaleFormatter::DateTimeScaleFormatter ( const DateTimeScaleFormatter &  other)

Definition at line 129 of file kdganttdatetimegrid.cpp.

DateTimeScaleFormatter::~DateTimeScaleFormatter ( )
virtual

Definition at line 134 of file kdganttdatetimegrid.cpp.

Member Function Documentation

Qt::Alignment DateTimeScaleFormatter::alignment ( ) const

Definition at line 179 of file kdganttdatetimegrid.cpp.

QDateTime DateTimeScaleFormatter::currentRangeBegin ( const QDateTime &  datetime) const
virtual
Returns
the QDateTime being the begin of the range containing datetime
See also
nextRangeBegin

Definition at line 242 of file kdganttdatetimegrid.cpp.

QString DateTimeScaleFormatter::format ( ) const
Returns
The format being used for formatting dates and times.

Definition at line 148 of file kdganttdatetimegrid.cpp.

QString DateTimeScaleFormatter::format ( const QDateTime &  datetime) const
Returns
The datetime as string respecting the format.

Definition at line 155 of file kdganttdatetimegrid.cpp.

QDateTime DateTimeScaleFormatter::nextRangeBegin ( const QDateTime &  datetime) const
virtual
Returns
the QDateTime being the begin of the range after the one containing datetime
See also
currentRangeBegin

Definition at line 187 of file kdganttdatetimegrid.cpp.

DateTimeScaleFormatter & DateTimeScaleFormatter::operator= ( const DateTimeScaleFormatter &  other)

Definition at line 139 of file kdganttdatetimegrid.cpp.

DateTimeScaleFormatter::Range DateTimeScaleFormatter::range ( ) const
Returns
The range of each item on a DateTimeGrid header.
See also
DateTimeScaleFormatter::Range

Definition at line 174 of file kdganttdatetimegrid.cpp.

QString DateTimeScaleFormatter::text ( const QDateTime &  datetime) const
virtual

Definition at line 167 of file kdganttdatetimegrid.cpp.


The documentation for this class was generated from the following files:
  • kdganttdatetimegrid.h
  • kdganttdatetimegrid.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