kexi
KexiTimeFormatter Class Reference
#include <kexidatetimeformatter.h>
Detailed Description
Time formatter used by KexiTimeTableEdit and KexiDateTimeTableEdit Following time formats are allowed: HH:MM:SS (24h), HH:MM (24h), HH:MM AM/PM (12h) Separator MUST be ":".
Definition at line 88 of file kexidatetimeformatter.h.
Public Member Functions | |
KexiTimeFormatter () | |
~KexiTimeFormatter () | |
QTime | stringToTime (const QString &str) const |
QVariant | stringToVariant (const QString &str) |
QString | timeToString (const QTime &time) const |
QString | inputMask () const |
bool | isEmpty (const QString &str) const |
Protected Attributes | |
QString | m_inputMask |
bool | m_24h |
bool | m_hoursWithLeadingZero |
QString | m_outputFormat |
int | m_hourpos |
int | m_minpos |
int | m_secpos |
int | m_ampmpos |
QRegExp * | m_hmsRegExp |
QRegExp * | m_hmRegExp |
Constructor & Destructor Documentation
KexiTimeFormatter::KexiTimeFormatter | ( | ) |
Creates new formatter with KDE setting for time.
CS
Definition at line 170 of file kexidatetimeformatter.cpp.
KexiTimeFormatter::~KexiTimeFormatter | ( | ) |
Member Function Documentation
QTime KexiTimeFormatter::stringToTime | ( | const QString & | str | ) | const |
converts string str to time using predefined settings
- Returns:
- invalid time if the conversion is impossible
Definition at line 242 of file kexidatetimeformatter.cpp.
QVariant KexiTimeFormatter::stringToVariant | ( | const QString & | str | ) |
Converts string str to time using predefined settings and returns QVariant containing the time value. This method does the same as stringToTime() but if string contains invalid time representation, e.g. contains only spaces and separators, null QVariant() is returned.
Definition at line 273 of file kexidatetimeformatter.cpp.
QString KexiTimeFormatter::timeToString | ( | const QTime & | time | ) | const |
converts time to string using predefined settings
- Returns:
- null string if time is invalid
Definition at line 289 of file kexidatetimeformatter.cpp.
QString KexiTimeFormatter::inputMask | ( | ) | const [inline] |
- Returns:
- Input mask generated using the formatter settings.
Can be used in QLineEdit::setInputMask().
Definition at line 116 of file kexidatetimeformatter.h.
bool KexiTimeFormatter::isEmpty | ( | const QString & | str | ) | const |
- Returns:
- true if str contains only spaces and separators according to the time format.
Definition at line 283 of file kexidatetimeformatter.cpp.
Member Data Documentation
QString KexiTimeFormatter::m_inputMask [protected] |
Input mask generated using the formatter settings. Can be used in QLineEdit::setInputMask().
Definition at line 124 of file kexidatetimeformatter.h.
bool KexiTimeFormatter::m_24h [protected] |
QString KexiTimeFormatter::m_outputFormat [protected] |
Time format used in timeToString(). Notation from KLocale::setTimeFormat() is used.
Definition at line 135 of file kexidatetimeformatter.h.
int KexiTimeFormatter::m_hourpos [protected] |
Used in stringToTime() to convert string back to QTime.
Definition at line 138 of file kexidatetimeformatter.h.
The documentation for this class was generated from the following files: