kexi
KexiTextFormatter Class Reference
#include <kexitextformatter.h>
Detailed Description
Text formatter used to format QVariant values to text for displaying and back to QVariant.Used by KexiInputTableEdit, KexiDateTableEdit, KexiTimeTableEdit, KexiDateTimeTableEdit, KexiDBLineEdit (forms), etc.
Definition at line 28 of file kexitextformatter.h.
Public Member Functions | |
void | setField (KexiDB::Field *field) |
QString | valueToText (const QVariant &value, const QString &add) const |
QVariant | textToValue (const QString &text) const |
bool | valueIsEmpty (const QString &text) const |
bool | valueIsValid (const QString &text) const |
QString | inputMask () const |
Public Attributes | |
Private * | d |
Member Function Documentation
void KexiTextFormatter::setField | ( | KexiDB::Field * | field | ) |
Assigns field to the formatter. This affects its behaviour.
Definition at line 55 of file kexitextformatter.cpp.
QString KexiTextFormatter::valueToText | ( | const QVariant & | value, | |
const QString & | add | |||
) | const |
- Returns:
- text for value. A field schema set using setField() is used to perform the formatting. add is a text that should be added to the value if possible. Used in KexiInputTableEdit::setValueInternal(), by form widgets and for reporting/printing.
- Todo:
- precision!
- Todo:
- support 'g' format
- Todo:
- temporary solution for booleans!
Definition at line 74 of file kexitextformatter.cpp.
QVariant KexiTextFormatter::textToValue | ( | const QString & | text | ) | const |
- Returns:
- value cnverted from text A field schema set using setField() is used to perform the formatting. Used in KexiInputTableEdit::setValueInternal(), by form widgets and for reporting/printing.
- Todo:
- uint, etc?
- Todo:
- temporary solution for booleans!
- Todo:
- more data types!
Definition at line 141 of file kexitextformatter.cpp.
bool KexiTextFormatter::valueIsEmpty | ( | const QString & | text | ) | const |
- Returns:
- true if value formatted as text is empty. A field schema set using setField() is used to perform the calculation.
Definition at line 182 of file kexitextformatter.cpp.
bool KexiTextFormatter::valueIsValid | ( | const QString & | text | ) | const |
- Returns:
- true if value formatted as text is valid. A field schema set using setField() is used to perform the calculation.
- Todo:
- fix for fields with "required" property = true
Definition at line 201 of file kexitextformatter.cpp.
QString KexiTextFormatter::inputMask | ( | ) | const |
- Returns:
- input mask for intering values related to a field schema which has been set using setField().
- Todo:
- use KDateWidget?
- Todo:
- use KTimeWidget
Definition at line 221 of file kexitextformatter.cpp.
The documentation for this class was generated from the following files: