#include <kexitextformatter.h>
Public Member Functions | |
| void | setField (KexiDB::Field *field) |
| TQString | valueToText (const TQVariant &value, const TQString &add) const |
| TQVariant | textToValue (const TQString &text) const |
| bool | valueIsEmpty (const TQString &text) const |
| bool | valueIsValid (const TQString &text) const |
| TQString | inputMask () const |
Public Attributes | |
| Private * | d |
Detailed Description
Text formatter used to format TQVariant values to text for displaying and back to TQVariant.
Used by KexiInputTableEdit, KexiDateTableEdit, KexiTimeTableEdit, KexiDateTimeTableEdit, KexiDBLineEdit (forms), etc.
Definition at line 28 of file kexitextformatter.h.
Constructor & Destructor Documentation
◆ KexiTextFormatter()
| KexiTextFormatter::KexiTextFormatter | ( | ) |
Definition at line 45 of file kexitextformatter.cpp.
◆ ~KexiTextFormatter()
| KexiTextFormatter::~KexiTextFormatter | ( | ) |
Definition at line 50 of file kexitextformatter.cpp.
Member Function Documentation
◆ inputMask()
| TQString 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.
◆ setField()
| void KexiTextFormatter::setField | ( | KexiDB::Field * | field | ) |
Assigns field to the formatter. This affects its behaviour.
Definition at line 55 of file kexitextformatter.cpp.
◆ textToValue()
| TQVariant KexiTextFormatter::textToValue | ( | const TQString & | 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.
◆ valueIsEmpty()
| bool KexiTextFormatter::valueIsEmpty | ( | const TQString & | 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.
◆ valueIsValid()
| bool KexiTextFormatter::valueIsValid | ( | const TQString & | 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.
◆ valueToText()
| TQString KexiTextFormatter::valueToText | ( | const TQVariant & | value, |
| const TQString & | 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.
Member Data Documentation
◆ d
| Private* KexiTextFormatter::d |
Definition at line 61 of file kexitextformatter.h.
The documentation for this class was generated from the following files:
