kexi
KexiDateTimeTableEdit Class Reference
#include <kexidatetimetableedit.h>
Inheritance diagram for KexiDateTimeTableEdit:

Detailed Description
Editor class for Date/Time type. It is a replacement QDateTimeEdit due to usability problems: people are accustomed to use single-character cursor. Date and Time format is retrieved from the KDE global settings and input/output is performed using KLineEdit (from KexiInputTableEdit).
Definition at line 34 of file kexidatetimetableedit.h.
Public Member Functions | |
KexiDateTimeTableEdit (KexiTableViewColumn &column, QScrollView *parent=0) | |
virtual | ~KexiDateTimeTableEdit () |
virtual void | setupContents (QPainter *p, bool focused, QVariant val, QString &txt, int &align, int &x, int &y_offset, int &w, int &h) |
virtual QVariant | value () |
virtual bool | valueIsNull () |
virtual bool | valueIsEmpty () |
virtual bool | valueIsValid () |
Protected Member Functions | |
virtual void | setValueInternal (const QVariant &add, bool removeOld) |
QDateTime | dateTimeValue () |
bool | textIsEmpty () const |
Protected Attributes | |
KexiDateFormatter | m_dateFormatter |
KexiTimeFormatter | m_timeFormatter |
Constructor & Destructor Documentation
KexiDateTimeTableEdit::KexiDateTimeTableEdit | ( | KexiTableViewColumn & | column, | |
QScrollView * | parent = 0 | |||
) |
Definition at line 49 of file kexidatetimetableedit.cpp.
Member Function Documentation
void KexiDateTimeTableEdit::setupContents | ( | QPainter * | p, | |
bool | focused, | |||
QVariant | val, | |||
QString & | txt, | |||
int & | align, | |||
int & | x, | |||
int & | y_offset, | |||
int & | w, | |||
int & | h | |||
) | [virtual] |
For reimplementation. Sets up anmd paints cell's contents using context of val value. focused is true if the cell is focused. align is set using Qt::AlignmentFlags. Some additional things may be painted using p, it's not needed to paint the text (this is done automatically outside.
Before calling, x, y_offset, w, h parameters are initialized, but you can tune these values depending on the context. You should set txt to a text representation of val, otherwise no text will be painted.
Reimplemented from KexiTableEdit.
Definition at line 87 of file kexidatetimetableedit.cpp.
void KexiDateTimeTableEdit::setValueInternal | ( | const QVariant & | add, | |
bool | removeOld | |||
) | [protected, virtual] |
initializes this editor with add value
- Todo:
- precision!
- Todo:
- (js): get decimal places settings here...
Reimplemented from KexiInputTableEdit.
Definition at line 65 of file kexidatetimetableedit.cpp.
QVariant KexiDateTimeTableEdit::value | ( | ) | [virtual] |
- Returns:
- value currently represented by this item.
Reimplemented from KexiInputTableEdit.
Definition at line 139 of file kexidatetimetableedit.cpp.
bool KexiDateTimeTableEdit::valueIsEmpty | ( | ) | [virtual] |
- Returns:
- true if editor's value is empty (not null). Only few field types can accept "EMPTY" property (check this with KexiDB::Field::hasEmptyProperty()),
Reimplemented from KexiInputTableEdit.
Definition at line 113 of file kexidatetimetableedit.cpp.
bool KexiDateTimeTableEdit::valueIsNull | ( | ) | [virtual] |
- Returns:
- true if editor's value is null (not empty)
Reimplemented from KexiInputTableEdit.
Definition at line 106 of file kexidatetimetableedit.cpp.
bool KexiDateTimeTableEdit::valueIsValid | ( | ) | [virtual] |
- Returns:
- true if editor's value is valid for a given type Used for checking if an entered value is valid, E.g. a part of time value can be entered: "12:8" and this is invalid, not only null. Null time or date is valid in Kexi, so it is not enough to test value().isValid(). Default implementation just returns true.
Reimplemented from KexiDataItemInterface.
Definition at line 146 of file kexidatetimetableedit.cpp.
Member Data Documentation
The documentation for this class was generated from the following files: