kexi
KexiTimeTableEdit Class Reference
#include <kexitimetableedit.h>
Inheritance diagram for KexiTimeTableEdit:

Detailed Description
Editor class for Time type. It is a replacement QTimeEdit due to usability problems: people are accustomed to use single-character cursor. Time format is retrieved from the KDE global settings and input/output is performed using KLineEdit (from KexiInputTableEdit).
Definition at line 32 of file kexitimetableedit.h.
Public Member Functions | |
KexiTimeTableEdit (KexiTableViewColumn &column, QWidget *parent=0) | |
virtual | ~KexiTimeTableEdit () |
virtual void | setupContents (QPainter *p, bool focused, const 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 () |
virtual void | handleAction (const QString &actionName) |
virtual void | handleCopyAction (const QVariant &value, const QVariant &visibleValue) |
Protected Member Functions | |
void | setValueInInternalEditor (const QVariant &value) |
virtual void | setValueInternal (const QVariant &add, bool removeOld) |
QTime | timeValue () |
Protected Attributes | |
KexiTimeFormatter | m_formatter |
Constructor & Destructor Documentation
KexiTimeTableEdit::KexiTimeTableEdit | ( | KexiTableViewColumn & | column, | |
QWidget * | parent = 0 | |||
) |
Definition at line 48 of file kexitimetableedit.cpp.
Member Function Documentation
void KexiTimeTableEdit::setupContents | ( | QPainter * | p, | |
bool | focused, | |||
const QVariant & | val, | |||
QString & | txt, | |||
int & | align, | |||
int & | x, | |||
int & | y_offset, | |||
int & | w, | |||
int & | h | |||
) | [virtual] |
For reimplementation. Sets up and 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, but it is not needed to paint the text (this is done automatically outside of this method).
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.
p can be 0 - in this case no painting should be performed, becasue caller only expects that x, y_offset, w, h, txt paramaters are tuned, if needed. p painter's pen is set to foreground color (usually black) that should be used to paint foreground information, if needed. For example boolean editor widget paints a rectangle using this color.
- Todo:
- ADD OPTION to displaying NULL VALUES as e.g. "(null)"
Reimplemented from KexiTableEdit.
Definition at line 84 of file kexitimetableedit.cpp.
QVariant KexiTimeTableEdit::value | ( | ) | [virtual] |
- Returns:
- value currently represented by this item.
Reimplemented from KexiInputTableEdit.
Definition at line 119 of file kexitimetableedit.cpp.
bool KexiTimeTableEdit::valueIsNull | ( | ) | [virtual] |
- Returns:
- true if editor's value is null (not empty)
Reimplemented from KexiInputTableEdit.
Definition at line 102 of file kexitimetableedit.cpp.
bool KexiTimeTableEdit::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 109 of file kexitimetableedit.cpp.
bool KexiTimeTableEdit::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 124 of file kexitimetableedit.cpp.
void KexiTimeTableEdit::handleAction | ( | const QString & | actionName | ) | [virtual] |
Reimplemented after KexiInputTableEdit.
Reimplemented from KexiInputTableEdit.
Definition at line 140 of file kexitimetableedit.cpp.
void KexiTimeTableEdit::handleCopyAction | ( | const QVariant & | value, | |
const QVariant & | visibleValue | |||
) | [virtual] |
Reimplemented after KexiInputTableEdit.
Reimplemented from KexiInputTableEdit.
Definition at line 131 of file kexitimetableedit.cpp.
void KexiTimeTableEdit::setValueInInternalEditor | ( | const QVariant & | value | ) | [protected] |
void KexiTimeTableEdit::setValueInternal | ( | const QVariant & | add, | |
bool | removeOld | |||
) | [protected, virtual] |
initializes this editor with add value
Reimplemented from KexiInputTableEdit.
Definition at line 70 of file kexitimetableedit.cpp.
Member Data Documentation
KexiTimeFormatter KexiTimeTableEdit::m_formatter [protected] |
The documentation for this class was generated from the following files: