KGantt::DateTimeScaleFormatter
#include <kganttdatetimegrid.h>
Public Types | |
| enum | Range {  Second , Minute , Hour , Day , Week , Month , Year }  | 
Public Member Functions | |
| DateTimeScaleFormatter (const DateTimeScaleFormatter &other) | |
| DateTimeScaleFormatter (Range range, const QString &formatString, const QString &templ, Qt::Alignment alignment=Qt::AlignCenter) | |
| DateTimeScaleFormatter (Range range, const QString &formatString, Qt::Alignment alignment=Qt::AlignCenter) | |
| 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:
Optionally, you can set an user defined text alignment flag. The default value is Qt::AlignCenter.
This class even controls the range of the grid sections.
- See also
 - KGanttDateTimeScaleFormatter::Range
 
Definition at line 309 of file kganttdatetimegrid.h.
Member Enumeration Documentation
◆ Range
| enum KGantt::DateTimeScaleFormatter::Range | 
Definition at line 313 of file kganttdatetimegrid.h.
Constructor & Destructor Documentation
◆ DateTimeScaleFormatter() [1/3]
| DateTimeScaleFormatter::DateTimeScaleFormatter | ( | Range | range, | 
| const QString & | formatString, | ||
| Qt::Alignment | alignment = Qt::AlignCenter ) | 
Creates a DateTimeScaleFormatter using range and format. The text on the header is aligned following alignment.
Definition at line 80 of file kganttdatetimegrid.cpp.
◆ DateTimeScaleFormatter() [2/3]
| DateTimeScaleFormatter::DateTimeScaleFormatter | ( | Range | range, | 
| const QString & | formatString, | ||
| const QString & | templ, | ||
| Qt::Alignment | alignment = Qt::AlignCenter ) | 
Definition at line 74 of file kganttdatetimegrid.cpp.
◆ DateTimeScaleFormatter() [3/3]
| DateTimeScaleFormatter::DateTimeScaleFormatter | ( | const DateTimeScaleFormatter & | other | ) | 
- Returns
 - The format being used for formatting dates and times.
 
Definition at line 85 of file kganttdatetimegrid.cpp.
◆ ~DateTimeScaleFormatter()
      
  | 
  virtual | 
Definition at line 90 of file kganttdatetimegrid.cpp.
Member Function Documentation
◆ alignment()
| Qt::Alignment DateTimeScaleFormatter::alignment | ( | ) | const | 
Definition at line 136 of file kganttdatetimegrid.cpp.
◆ currentRangeBegin()
- Returns
 - the QDateTime being the begin of the range containing datetime
 
- See also
 - nextRangeBegin
 
Definition at line 195 of file kganttdatetimegrid.cpp.
◆ format() [1/2]
| QString DateTimeScaleFormatter::format | ( | ) | const | 
- Returns
 - The format string
 
Definition at line 106 of file kganttdatetimegrid.cpp.
◆ format() [2/2]
- Returns
 - The datetime as string respecting the format.
 
Definition at line 112 of file kganttdatetimegrid.cpp.
◆ nextRangeBegin()
- Returns
 - the QDateTime being the begin of the range after the one containing datetime
 
- See also
 - currentRangeBegin
 
Definition at line 142 of file kganttdatetimegrid.cpp.
◆ operator=()
| DateTimeScaleFormatter & DateTimeScaleFormatter::operator= | ( | const DateTimeScaleFormatter & | other | ) | 
Definition at line 95 of file kganttdatetimegrid.cpp.
◆ range()
| DateTimeScaleFormatter::Range DateTimeScaleFormatter::range | ( | ) | const | 
- Returns
 - The range of each item on a DateTimeGrid header.
 
- See also
 - DateTimeScaleFormatter::Range
 
Definition at line 131 of file kganttdatetimegrid.cpp.
◆ text()
Definition at line 125 of file kganttdatetimegrid.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri May 2 2025 11:54:20 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.