kexi

KexiInputTableEdit Class Reference

#include <kexiinputtableedit.h>

Inheritance diagram for KexiInputTableEdit:

KexiTableEdit KexiDataItemInterface KexiComboBoxTableEdit KexiDateTableEdit KexiDateTimeTableEdit KexiTimeTableEdit List of all members.

Detailed Description

General purpose cell editor using line edit widget.

Definition at line 32 of file kexiinputtableedit.h.


Public Slots

virtual void moveCursorToEnd ()
virtual void moveCursorToStart ()
virtual void selectAll ()

Signals

void hintClicked ()

Public Member Functions

 KexiInputTableEdit (KexiTableViewColumn &column, QWidget *parent=0)
virtual ~KexiInputTableEdit ()
virtual bool valueChanged ()
virtual bool valueIsNull ()
virtual bool valueIsEmpty ()
virtual QVariant value ()
virtual bool cursorAtStart ()
virtual bool cursorAtEnd ()
virtual void clear ()
virtual QSize totalSize ()
virtual void handleAction (const QString &actionName)
virtual void handleCopyAction (const QVariant &value, const QVariant &visibleValue)
virtual bool showToolTipIfNeeded (const QVariant &value, const QRect &rect, const QFontMetrics &fm, bool focused)

Protected Slots

void setRestrictedCompletion ()
void completed (const QString &)

Protected Member Functions

virtual void setValueInternal (const QVariant &add, bool removeOld)
void showHintButton ()
void init ()
virtual void paintEvent (QPaintEvent *e)
QString valueToText (const QVariant &value, const QString &add, bool setValidator=false)

Protected Attributes

bool m_calculatedCell
QString m_decsym
QString m_origText
KLineEdit * m_lineedit

Member Function Documentation

bool KexiInputTableEdit::valueChanged (  )  [virtual]

Returns:
true if editor's value is changed (compared to original value)

Reimplemented from KexiDataItemInterface.

Reimplemented in KexiComboBoxTableEdit.

Definition at line 248 of file kexiinputtableedit.cpp.

bool KexiInputTableEdit::valueIsNull (  )  [virtual]

Returns:
true if editor's value is null (not empty)

Implements KexiDataItemInterface.

Reimplemented in KexiDateTableEdit, KexiDateTimeTableEdit, and KexiTimeTableEdit.

Definition at line 255 of file kexiinputtableedit.cpp.

bool KexiInputTableEdit::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()),

Implements KexiDataItemInterface.

Reimplemented in KexiDateTableEdit, KexiDateTimeTableEdit, and KexiTimeTableEdit.

Definition at line 260 of file kexiinputtableedit.cpp.

QVariant KexiInputTableEdit::value (  )  [virtual]

Returns:
value currently represented by this item.

Implements KexiDataItemInterface.

Reimplemented in KexiComboBoxTableEdit, KexiDateTableEdit, KexiDateTimeTableEdit, and KexiTimeTableEdit.

Definition at line 265 of file kexiinputtableedit.cpp.

bool KexiInputTableEdit::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 400 of file kexiinputtableedit.cpp.

bool KexiInputTableEdit::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 405 of file kexiinputtableedit.cpp.

void KexiInputTableEdit::clear (  )  [virtual]

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

Implements KexiDataItemInterface.

Reimplemented in KexiComboBoxTableEdit.

Definition at line 395 of file kexiinputtableedit.cpp.

QSize KexiInputTableEdit::totalSize (  )  [virtual]

Returns:
total size of this editor, including any buttons, etc. (if present).

Reimplemented from KexiTableEdit.

Definition at line 410 of file kexiinputtableedit.cpp.

void KexiInputTableEdit::handleAction ( const QString &  actionName  )  [virtual]

Handles action having standard name actionName. Action could be: "edit_cut", "edit_paste", etc.

Todo:
handle rich text?

Reimplemented from KexiDataItemInterface.

Reimplemented in KexiComboBoxTableEdit, KexiDateTableEdit, KexiDateTimeTableEdit, and KexiTimeTableEdit.

Definition at line 424 of file kexiinputtableedit.cpp.

void KexiInputTableEdit::handleCopyAction ( const QVariant &  value,
const QVariant &  visibleValue 
) [virtual]

Handles copy action for value. The value is copied to clipboard in format appropriate for the editor's impementation, e.g. for image cell it can be a pixmap. visibleValue is unused here. Reimplemented after KexiTableEdit.

Todo:
handle rich text?

Implements KexiTableEdit.

Reimplemented in KexiComboBoxTableEdit, KexiDateTableEdit, KexiDateTimeTableEdit, and KexiTimeTableEdit.

Definition at line 417 of file kexiinputtableedit.cpp.

bool KexiInputTableEdit::showToolTipIfNeeded ( const QVariant &  value,
const QRect &  rect,
const QFontMetrics &  fm,
bool  focused 
) [virtual]

Shows a special tooltip for value if needed, i.e. if the value could not fit inside rect for a given font metrics fm.

Returns:
true a normal tooltip should be displayed (using QToolTip,) and false if no tooltip should be displayed or a custom tooltip was displayed internally (not yet supported). This implementation converts the value to text using valueToText() if calue is not string to see whether it can fit inside the cell's rect. If the cell is currentl focused (selected), focused is true.

setValidator

Reimplemented from KexiTableEdit.

Definition at line 445 of file kexiinputtableedit.cpp.

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

Implemented for KexiDataItemInterface.

mark

Reimplemented from KexiDataItemInterface.

Reimplemented in KexiComboBoxTableEdit.

Definition at line 457 of file kexiinputtableedit.cpp.

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

Implemented for KexiDataItemInterface.

mark

Reimplemented from KexiDataItemInterface.

Reimplemented in KexiComboBoxTableEdit.

Definition at line 462 of file kexiinputtableedit.cpp.

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

Implemented for KexiDataItemInterface.

Reimplemented from KexiDataItemInterface.

Reimplemented in KexiComboBoxTableEdit.

Definition at line 467 of file kexiinputtableedit.cpp.

void KexiInputTableEdit::setValueInternal ( const QVariant &  add,
bool  removeOld 
) [protected, virtual]

initializes this editor with add value

Implements KexiDataItemInterface.

Reimplemented in KexiComboBoxTableEdit, KexiDateTableEdit, KexiDateTimeTableEdit, and KexiTimeTableEdit.

Definition at line 117 of file kexiinputtableedit.cpp.

QString KexiInputTableEdit::valueToText ( const QVariant &  value,
const QString &  add,
bool  setValidator = false 
) [protected]

Returns:
text for value. add is a text that should be added to the value if possible. If setValidator is true, an appropriate validator will be setup for the internal line edit widget when needed.

Todo:
precision!

support 'g' format

Todo:
add command line settings?

Todo:
(js): get decimal places settings here...

Todo:
implement ranges here!

Todo:
use field->isUnsigned() for KexiUtils::ULongLongValidator

Definition at line 140 of file kexiinputtableedit.cpp.


Member Data Documentation

QString KexiInputTableEdit::m_origText [protected]

decimal symbol

Definition at line 112 of file kexiinputtableedit.h.

KLineEdit* KexiInputTableEdit::m_lineedit [protected]

orig. Line Edit's text after conversion - for easy comparing

Definition at line 113 of file kexiinputtableedit.h.


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