kexi

KexiDBLineEdit Class Reference

#include <kexidblineedit.h>

Inheritance diagram for KexiDBLineEdit:

KexiDBTextWidgetInterface KexiFormDataItemInterface KexiSubwidgetInterface KexiDataItemInterface List of all members.

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 44 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 *)
KexiDateFormatterdateFormatter ()
KexiTimeFormattertimeFormatter ()
virtual QPopupMenu * createPopupMenu ()
virtual bool appendStretchRequired (KexiDBAutoField *autoField) const

Protected Attributes

KexiDateFormatterm_dateFormatter
KexiTimeFormatterm_timeFormatter
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 59 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 60 of file kexidblineedit.h.

QVariant KexiDBLineEdit::value (  )  [virtual]

Returns:
value currently represented by this item.

Implements KexiDataItemInterface.

Definition at line 143 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 188 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.

Todo:

Implements KexiDataItemInterface.

Definition at line 193 of file kexidblineedit.cpp.

bool KexiDBLineEdit::valueIsValid (  )  [virtual]

Returns:
true if the value is valid

Todo:
fix for fields with "required" property = true

Todo:

Reimplemented from KexiDataItemInterface.

Definition at line 212 of file kexidblineedit.cpp.

bool KexiDBLineEdit::isReadOnly (  )  const [virtual]

Returns:
'readOnly' flag for this widget.

Reimplemented from KexiDataItemInterface.

Definition at line 232 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 363 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 266 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 271 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 276 of file kexidblineedit.cpp.

void KexiDBLineEdit::clear (  )  [virtual]

clears item's data, so the data will contain NULL data

Implements KexiDataItemInterface.

Definition at line 281 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 288 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.

Todo:
?

Reimplemented from KexiDataItemInterface.

Definition at line 349 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 395 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 104 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 105 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 237 of file kexidblineedit.cpp.

void KexiDBLineEdit::undo (  )  [virtual, slot]

Reimplemented, so "undo" means the same as "cancelEditor" action.

Definition at line 375 of file kexidblineedit.cpp.

void KexiDBLineEdit::moveCursorToEnd (  )  [virtual, slot]

Implemented for KexiDataItemInterface.

mark

Reimplemented from KexiDataItemInterface.

Definition at line 380 of file kexidblineedit.cpp.

void KexiDBLineEdit::moveCursorToStart (  )  [virtual, slot]

Implemented for KexiDataItemInterface.

mark

Reimplemented from KexiDataItemInterface.

Definition at line 385 of file kexidblineedit.cpp.

void KexiDBLineEdit::selectAll (  )  [virtual, slot]

Implemented for KexiDataItemInterface.

Reimplemented from KexiDataItemInterface.

Definition at line 390 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 328 of file kexidblineedit.cpp.

bool KexiDBLineEdit::appendStretchRequired ( KexiDBAutoField autoField  )  const [protected, virtual]

Implemented for KexiSubwidgetInterface.

Reimplemented from KexiSubwidgetInterface.

Definition at line 344 of file kexidblineedit.cpp.


Member Data Documentation

Used for date and date/time types.

Definition at line 142 of file kexidblineedit.h.

Used for time and date/time types.

Definition at line 145 of file kexidblineedit.h.

QGuardedPtr<const QValidator> KexiDBLineEdit::m_readOnlyValidator [protected]

Used for read only flag to disable editing.

Definition at line 148 of file kexidblineedit.h.

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 151 of file kexidblineedit.h.

Used for extending context menu.

Definition at line 154 of file kexidblineedit.h.

Used in isReadOnly, as sometimes we want to have the flag set tot true when KLineEdit::isReadOnly is still false.

Definition at line 158 of file kexidblineedit.h.

Used in slotTextChanged().

Definition at line 161 of file kexidblineedit.h.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys