kexi

KexiBoolTableEdit Class Reference

#include <kexibooltableedit.h>

Inheritance diagram for KexiBoolTableEdit:

KexiTableEdit KexiDataItemInterface List of all members.

Detailed Description

Cell editor for boolean type.

Definition at line 30 of file kexibooltableedit.h.


Signals

void hintClicked ()

Public Member Functions

 KexiBoolTableEdit (KexiTableViewColumn &column, QWidget *parent=0)
virtual ~KexiBoolTableEdit ()
virtual bool valueIsNull ()
virtual bool valueIsEmpty ()
virtual QVariant value ()
virtual bool cursorAtStart ()
virtual bool cursorAtEnd ()
virtual void clear ()
virtual void setupContents (QPainter *p, bool focused, const QVariant &val, QString &txt, int &align, int &x, int &y_offset, int &w, int &h)
virtual void clickedOnContents ()
virtual void handleAction (const QString &actionName)
virtual void handleCopyAction (const QVariant &value, const QVariant &visibleValue)
virtual int widthForValue (QVariant &val, const QFontMetrics &fm)

Protected Member Functions

virtual void setValueInternal (const QVariant &add, bool removeOld)
void showHintButton ()

Protected Attributes

QVariant m_currentValue

Member Function Documentation

bool KexiBoolTableEdit::valueIsNull (  )  [virtual]

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

Implements KexiDataItemInterface.

Definition at line 55 of file kexibooltableedit.cpp.

bool KexiBoolTableEdit::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.

Definition at line 60 of file kexibooltableedit.cpp.

QVariant KexiBoolTableEdit::value (  )  [virtual]

Returns:
value currently represented by this item.

Implements KexiDataItemInterface.

Definition at line 65 of file kexibooltableedit.cpp.

bool KexiBoolTableEdit::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 79 of file kexibooltableedit.cpp.

bool KexiBoolTableEdit::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 84 of file kexibooltableedit.cpp.

void KexiBoolTableEdit::clear (  )  [virtual]

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

Implements KexiDataItemInterface.

Definition at line 71 of file kexibooltableedit.cpp.

void KexiBoolTableEdit::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 parameters 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 89 of file kexibooltableedit.cpp.

void KexiBoolTableEdit::clickedOnContents (  )  [virtual]

Allows to define reaction for clicking on cell's contents. Currently it's used for editor of type boolean, where we want to toggle true/false on single mouse click.

See also:
hasFocusableWidget(), KexiBoolTableEdit. Default implementation does nothing.

Reimplemented from KexiDataItemInterface.

Definition at line 120 of file kexibooltableedit.cpp.

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

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

Todo:
handle defaultValue...

Reimplemented from KexiDataItemInterface.

Definition at line 133 of file kexibooltableedit.cpp.

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

Handles copy action for value. Copies empty string for null, "1" for true, "0" for false. visibleValue is unused here. Reimplemented after KexiTableEdit.

Implements KexiTableEdit.

Definition at line 160 of file kexibooltableedit.cpp.

int KexiBoolTableEdit::widthForValue ( QVariant &  val,
const QFontMetrics &  fm 
) [virtual]

Returns:
width of value. Reimplemented after KexiTableEdit.

Reimplemented from KexiTableEdit.

Definition at line 169 of file kexibooltableedit.cpp.

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

initializes this editor with add value

Implements KexiDataItemInterface.

Definition at line 49 of file kexibooltableedit.cpp.


Member Data Documentation

QVariant KexiBoolTableEdit::m_currentValue [protected]

We've no editor widget that would store current value, so we do this here.

Definition at line 79 of file kexibooltableedit.h.


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