kexi
KexiDBLineEdit Class Reference
#include <kexidblineedit.h>
Inheritance diagram for KexiDBLineEdit:

Detailed Description
Line edit widget for Kexi forms.Handles many data types. User input is validated by using validators and/or input masks.
Definition at line 43 of file kexidblineedit.h.
Public Slots | |
void | setDataSource (const QString &ds) |
void | setDataSourceMimeType (const QCString &ds) |
virtual void | setReadOnly (bool readOnly) |
virtual void | undo () |
virtual void | moveCursorToEnd () |
virtual void | moveCursorToStart () |
virtual void | selectAll () |
Public Member Functions | |
KexiDBLineEdit (QWidget *parent, const char *name=0) | |
virtual | ~KexiDBLineEdit () |
QString | dataSource () const |
QCString | dataSourceMimeType () const |
virtual QVariant | value () |
virtual void | setInvalidState (const QString &displayText) |
virtual bool | valueIsNull () |
virtual bool | valueIsEmpty () |
virtual bool | valueIsValid () |
virtual bool | isReadOnly () const |
virtual void | setDisplayDefaultValue (QWidget *widget, bool displayDefaultValue) |
virtual QWidget * | widget () |
virtual bool | cursorAtStart () |
virtual bool | cursorAtEnd () |
virtual void | clear () |
virtual void | setColumnInfo (KexiDB::QueryColumnInfo *cinfo) |
virtual void | handleAction (const QString &actionName) |
virtual bool | keyPressed (QKeyEvent *ke) |
Protected Slots | |
void | slotTextChanged (const QString &) |
Protected Member Functions | |
virtual void | paintEvent (QPaintEvent *) |
virtual void | setValueInternal (const QVariant &add, bool removeOld) |
virtual bool | event (QEvent *) |
virtual QPopupMenu * | createPopupMenu () |
virtual bool | appendStretchRequired (KexiDBAutoField *autoField) const |
Protected Attributes | |
KexiTextFormatter | m_textFormatter |
QGuardedPtr< const QValidator > | m_readOnlyValidator |
QGuardedPtr< const QValidator > | m_readWriteValidator |
KexiDBWidgetContextMenuExtender | m_menuExtender |
bool | m_internalReadOnly: 1 |
bool | m_slotTextChanged_enabled: 1 |
Properties | |
QString | dataSource [] |
QCString | dataSourceMimeType [] |
Member Function Documentation
QString KexiDBLineEdit::dataSource | ( | ) | const [inline] |
- Returns:
- the name of the data source for this widget.
Data source usually means here a table or query, a field name or an expression.
Reimplemented from KexiFormDataItemInterface.
Definition at line 58 of file kexidblineedit.h.
QCString KexiDBLineEdit::dataSourceMimeType | ( | ) | const [inline] |
- Returns:
- the mime type of the data source for this widget. Data source mime type means here types like "kexi/table" or "kexi/query" in.the data source is set to object (as within form or subform) or is empty if the data source is set to table field or query column.
Reimplemented from KexiFormDataItemInterface.
Definition at line 59 of file kexidblineedit.h.
QVariant KexiDBLineEdit::value | ( | ) | [virtual] |
- Returns:
- value currently represented by this item.
Implements KexiDataItemInterface.
Definition at line 145 of file kexidblineedit.cpp.
void KexiDBLineEdit::setInvalidState | ( | const QString & | displayText | ) | [virtual] |
Sets 'invalid' state, e.g. a text editor widget should display text displayText and become read only to prevent entering data, because updating at the database backend is not available. displayText is usually set to something i18n'd like "#NAME?". Note: that even widgets that usualy do not display texts (e.g. pixmaps) should display displayText too.
Implements KexiFormDataItemInterface.
Definition at line 79 of file kexidblineedit.cpp.
bool KexiDBLineEdit::valueIsNull | ( | ) | [virtual] |
- Returns:
- true if editor's value is null (not empty) Used for checking if a given constraint within table of form is met.
Implements KexiDataItemInterface.
Definition at line 192 of file kexidblineedit.cpp.
bool KexiDBLineEdit::valueIsEmpty | ( | ) | [virtual] |
- Returns:
- true if editor's value is empty (not necessary null).
Only few data types can accept "EMPTY" property (use KexiDB::Field::hasEmptyProperty() to check this). Used for checking if a given constraint within table or form is met.
Implements KexiDataItemInterface.
Definition at line 197 of file kexidblineedit.cpp.
bool KexiDBLineEdit::valueIsValid | ( | ) | [virtual] |
- Returns:
- true if the value is valid
Reimplemented from KexiDataItemInterface.
Definition at line 219 of file kexidblineedit.cpp.
bool KexiDBLineEdit::isReadOnly | ( | ) | const [virtual] |
- Returns:
- 'readOnly' flag for this widget.
Reimplemented from KexiDataItemInterface.
Definition at line 242 of file kexidblineedit.cpp.
void KexiDBLineEdit::setDisplayDefaultValue | ( | QWidget * | widget, | |
bool | displayDefaultValue | |||
) | [virtual] |
If displayDefaultValue is true, the value set by KexiDataItemInterface::setValue() is displayed in a special way. Used by KexiFormDataProvider::fillDataItems(). widget is equal to 'this'. Reimplemented after KexiFormDataItemInterface.
Reimplemented from KexiFormDataItemInterface.
Definition at line 379 of file kexidblineedit.cpp.
QWidget * KexiDBLineEdit::widget | ( | ) | [virtual] |
- Returns:
- the view widget of this item, e.g. line edit widget.
Reimplemented from KexiFormDataItemInterface.
Definition at line 276 of file kexidblineedit.cpp.
bool KexiDBLineEdit::cursorAtStart | ( | ) | [virtual] |
- Returns:
- true if the item widget's cursor (whatever that means, eg. line edit cursor) is at the beginning of editor's contents. This can inform table/form view that after pressing "left arrow" key should stop editing and move to a field on the left hand.
Implements KexiDataItemInterface.
Definition at line 281 of file kexidblineedit.cpp.
bool KexiDBLineEdit::cursorAtEnd | ( | ) | [virtual] |
- Returns:
- true if the item widget's cursor (whatever that means, eg. line edit cursor) is at the end of editor's contents. This can inform table/form view that after pressing "right arrow" key should stop editing and move to a field on the right hand.
Implements KexiDataItemInterface.
Definition at line 286 of file kexidblineedit.cpp.
void KexiDBLineEdit::clear | ( | ) | [virtual] |
clears item's data, so the data will contain NULL data
Implements KexiDataItemInterface.
Definition at line 291 of file kexidblineedit.cpp.
void KexiDBLineEdit::setColumnInfo | ( | KexiDB::QueryColumnInfo * | cinfo | ) | [virtual] |
Used internally to set database column information. Reimplement if you need to do additional actions, e.g. set data validator based on field type. Don't forget about calling superclass implementation.
Reimplemented from KexiFormDataItemInterface.
Definition at line 298 of file kexidblineedit.cpp.
void KexiDBLineEdit::handleAction | ( | const QString & | actionName | ) | [virtual] |
Handles action having standard name actionName. Action could be: "edit_copy", "edit_paste", etc. Reimplemented after KexiDataItemChangesListener.
Reimplemented from KexiDataItemInterface.
Definition at line 365 of file kexidblineedit.cpp.
bool KexiDBLineEdit::keyPressed | ( | QKeyEvent * | ke | ) | [virtual] |
Called by top-level form on key press event to consume widget-specific shortcuts.
Reimplemented from KexiFormDataItemInterface.
Definition at line 411 of file kexidblineedit.cpp.
void KexiDBLineEdit::setDataSource | ( | const QString & | ds | ) | [inline, slot] |
Sets the name of the data source for this widget.
Data source usually means here a table or query or field name name.
Reimplemented from KexiFormDataItemInterface.
Definition at line 103 of file kexidblineedit.h.
void KexiDBLineEdit::setDataSourceMimeType | ( | const QCString & | ds | ) | [inline, slot] |
Sets the mime type of the data source for this widget. Data source usually means here a "kexi/table" or "kexi/query".
- See also:
- dataSourceMimeType()
Reimplemented from KexiFormDataItemInterface.
Definition at line 104 of file kexidblineedit.h.
void KexiDBLineEdit::setReadOnly | ( | bool | readOnly | ) | [virtual, slot] |
Changes 'read only' flag, for this widget. Typically this flag can be passed to a widget itself, e.g. KLineEdit::setReadOnly(bool).
Implements KexiFormDataItemInterface.
Definition at line 247 of file kexidblineedit.cpp.
void KexiDBLineEdit::undo | ( | ) | [virtual, slot] |
Reimplemented, so "undo" means the same as "cancelEditor" action.
Definition at line 391 of file kexidblineedit.cpp.
void KexiDBLineEdit::moveCursorToEnd | ( | ) | [virtual, slot] |
Implemented for KexiDataItemInterface.
mark
Reimplemented from KexiDataItemInterface.
Definition at line 396 of file kexidblineedit.cpp.
void KexiDBLineEdit::moveCursorToStart | ( | ) | [virtual, slot] |
Implemented for KexiDataItemInterface.
mark
Reimplemented from KexiDataItemInterface.
Definition at line 401 of file kexidblineedit.cpp.
void KexiDBLineEdit::selectAll | ( | ) | [virtual, slot] |
Implemented for KexiDataItemInterface.
Reimplemented from KexiDataItemInterface.
Definition at line 406 of file kexidblineedit.cpp.
void KexiDBLineEdit::setValueInternal | ( | const QVariant & | add, | |
bool | removeOld | |||
) | [protected, virtual] |
Initializes this editor with add value, which should be somewhat added to the current value (already storted in m_origValue). If removeOld is true, a value should be set to add, otherwise -it should be set to current m_origValue + add, if possible. Implement this.
Implements KexiDataItemInterface.
Definition at line 88 of file kexidblineedit.cpp.
bool KexiDBLineEdit::event | ( | QEvent * | ) | [protected, virtual] |
Definition at line 344 of file kexidblineedit.cpp.
bool KexiDBLineEdit::appendStretchRequired | ( | KexiDBAutoField * | autoField | ) | const [protected, virtual] |
Implemented for KexiSubwidgetInterface.
Reimplemented from KexiSubwidgetInterface.
Definition at line 360 of file kexidblineedit.cpp.
Member Data Documentation
KexiTextFormatter KexiDBLineEdit::m_textFormatter [protected] |
QGuardedPtr<const QValidator> KexiDBLineEdit::m_readOnlyValidator [protected] |
QGuardedPtr<const QValidator> KexiDBLineEdit::m_readWriteValidator [protected] |
Used to remember the previous validator used forf r/w mode, after setting the read only flag.
Definition at line 157 of file kexidblineedit.h.
bool KexiDBLineEdit::m_internalReadOnly [protected] |
Used in isReadOnly, as sometimes we want to have the flag set tot true when KLineEdit::isReadOnly is still false.
Definition at line 164 of file kexidblineedit.h.
bool KexiDBLineEdit::m_slotTextChanged_enabled [protected] |
The documentation for this class was generated from the following files: