kexi

KexiDateFormatter Class Reference

#include <kexidatetableedit.h>

List of all members.


Detailed Description

Date formatter used by KexiDateTableEdit and KexiDateTimeTableEdit.

Definition at line 30 of file kexidatetableedit.h.


Public Member Functions

 KexiDateFormatter ()
 ~KexiDateFormatter ()
QDate stringToDate (const QString &str) const
QString dateToString (const QDate &date) const
QString inputMask () const
QString separator () const

Protected Attributes

QString m_inputMask
QDateEdit::Order m_order
bool m_longYear
bool m_monthWithLeadingZero
bool m_dayWithLeadingZero
QString m_qtFormat
int m_yearpos
int m_monthpos
int m_daypos
QString m_separator

Constructor & Destructor Documentation

KexiDateFormatter::KexiDateFormatter  ) 
 

Creates new formatter with KDE setting for "short date".

Todo:
allow to override the format using column property and/or global app settings
Todo:
more variables are possible here, see void KLocale::setDateFormatShort() docs http://developer.kde.org/documentation/library/3.5-api/kdelibs-apidocs/kdecore/html/classKLocale.html#a59
Todo:
use QRegExp (to replace Y by 1, etc.) instead of hardcoded "%1%299%399" because df may contain also other characters

Definition at line 49 of file kexidatetableedit.cpp.

KexiDateFormatter::~KexiDateFormatter  ) 
 

Todo:
KexiDateFormatter(... settings ...);

Definition at line 134 of file kexidatetableedit.cpp.


Member Function Documentation

QString KexiDateFormatter::dateToString const QDate &  date  )  const
 

converts date to string using predefined settings

Returns:
null string if date is invalid

Definition at line 165 of file kexidatetableedit.cpp.

QString KexiDateFormatter::inputMask  )  const [inline]
 

Returns:
Input mask generated using the formatter settings. Can be used in QLineEdit::setInputMask().

Definition at line 51 of file kexidatetableedit.h.

QDate KexiDateFormatter::stringToDate const QString &  str  )  const
 

converts string str to date using predefined settings

Returns:
invalid date if the conversion is impossible

Definition at line 138 of file kexidatetableedit.cpp.


Member Data Documentation

QString KexiDateFormatter::m_inputMask [protected]
 

Input mask generated using the formatter settings. Can be used in QLineEdit::setInputMask().

Definition at line 57 of file kexidatetableedit.h.

bool KexiDateFormatter::m_longYear [protected]
 

4 or 2 digits

Definition at line 63 of file kexidatetableedit.h.

QDateEdit::Order KexiDateFormatter::m_order [protected]
 

Order of date sections.

Definition at line 60 of file kexidatetableedit.h.

QString KexiDateFormatter::m_qtFormat [protected]
 

Date format used in dateToString().

Definition at line 68 of file kexidatetableedit.h.

int KexiDateFormatter::m_yearpos [protected]
 

Used in stringToDate() to convert string back to QDate.

Definition at line 71 of file kexidatetableedit.h.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys