kexi
KexiTableEdit Class Reference
#include <kexitableedit.h>
Inheritance diagram for KexiTableEdit:

Detailed Description
Abstract class for a cell editor.
Definition at line 38 of file kexitableedit.h.
Signals | |
void | editRequested () |
void | cancelRequested () |
void | acceptRequested () |
Public Member Functions | |
KexiTableEdit (KexiTableViewColumn &column, QScrollView *parent=0, const char *name=0) | |
virtual | ~KexiTableEdit () |
virtual KexiDB::Field * | field () const |
virtual KexiDB::QueryColumnInfo * | columnInfo () const |
virtual void | setColumnInfo (KexiDB::QueryColumnInfo *) |
KexiTableViewColumn * | column () const |
virtual void | resize (int w, int h) |
virtual QWidget * | widget () |
virtual void | hideWidget () |
virtual void | showWidget () |
virtual void | paintFocusBorders (QPainter *p, QVariant &cal, int x, int y, int w, int h) |
virtual void | setupContents (QPainter *p, bool focused, QVariant val, QString &txt, int &align, int &x, int &y_offset, int &w, int &h) |
virtual void | paintSelectionBackground (QPainter *p, bool focused, const QString &txt, int align, int x, int y_offset, int w, int h, const QColor &fillColor, bool readOnly, bool fullRowSelection) |
int | leftMargin () const |
int | rightMargin () const |
virtual bool | handleKeyPress (QKeyEvent *, bool) |
virtual int | widthForValue (QVariant &val, QFontMetrics &fm) |
virtual QSize | totalSize () |
Protected Member Functions | |
virtual bool | eventFilter (QObject *watched, QEvent *e) |
void | setViewWidget (QWidget *v) |
void | moveChild (QWidget *child, int x, int y) |
Protected Attributes | |
KexiTableViewColumn * | m_column |
int | m_leftMargin |
int | m_rightMargin |
QScrollView * | m_scrollView |
Member Function Documentation
KexiTableViewColumn* KexiTableEdit::column | ( | ) | const [inline] |
- Returns:
- column information for this item (extended information, comparing to field()).
Definition at line 61 of file kexitableedit.h.
virtual KexiDB::QueryColumnInfo* KexiTableEdit::columnInfo | ( | ) | const [inline, virtual] |
A rich field information for db-aware data. For not-db-aware data it is always 0 (use field() instead.
Implements KexiDataItemInterface.
Definition at line 53 of file kexitableedit.h.
virtual KexiDB::Field* KexiTableEdit::field | ( | ) | const [inline, virtual] |
Implemented for KexiDataItemInterface.
- Returns:
- field information for this item
Implements KexiDataItemInterface.
Definition at line 49 of file kexitableedit.h.
virtual bool KexiTableEdit::handleKeyPress | ( | QKeyEvent * | , | |
bool | ||||
) | [inline, virtual] |
Handles ke key event that came over the column that is bound to this editor. For implementation: true should be returned if ke should be accepted. If editorActive is true, this editor is currently active, i.e. the table view is in edit mode. By default false is returned.
Reimplemented in KexiComboBoxTableEdit.
Definition at line 115 of file kexitableedit.h.
virtual void KexiTableEdit::hideWidget | ( | ) | [inline, virtual] |
Hides item's widget, if available.
Reimplemented from KexiDataItemInterface.
Definition at line 70 of file kexitableedit.h.
int KexiTableEdit::leftMargin | ( | ) | const [inline] |
Sometimes, editor can contain non-standard margin, for example combobox editor contains dropdown button at the right side.
- Returns:
- left margin's size; 0 by default. For reimplementation.
Definition at line 104 of file kexitableedit.h.
void KexiTableEdit::moveChild | ( | QWidget * | child, | |
int | x, | |||
int | y | |||
) | [inline, protected] |
Moves child widget within the viewport. Use this for child widgets that are outside of this editor widget, instead of calling QWidget::move().
Definition at line 140 of file kexitableedit.h.
void KexiTableEdit::paintFocusBorders | ( | QPainter * | p, | |
QVariant & | cal, | |||
int | x, | |||
int | y, | |||
int | w, | |||
int | h | |||
) | [virtual] |
Paints a border for the cell described by x, y, w, h on p painter. The cell's value is val (may be usefull if you want to reimplement this method).
Reimplemented in KexiComboBoxTableEdit.
Definition at line 127 of file kexitableedit.cpp.
void KexiTableEdit::paintSelectionBackground | ( | QPainter * | p, | |
bool | focused, | |||
const QString & | txt, | |||
int | align, | |||
int | x, | |||
int | y_offset, | |||
int | w, | |||
int | h, | |||
const QColor & | fillColor, | |||
bool | readOnly, | |||
bool | fullRowSelection | |||
) | [virtual] |
For reimplementation. Paints selection's background using p. Most parameters are similar to these from setupContents().
Definition at line 215 of file kexitableedit.cpp.
void KexiTableEdit::resize | ( | int | w, | |
int | h | |||
) | [virtual] |
Reimplemented: resizes a view().
Reimplemented in KexiComboBoxTableEdit.
Definition at line 84 of file kexitableedit.cpp.
int KexiTableEdit::rightMargin | ( | ) | const [inline] |
Sometimes, editor can contain non-standard margin, for example combobox editor contains dropdown button at the right side.
- Returns:
- right margin;s size; 0 by default. For reimplementation.
Definition at line 109 of file kexitableedit.h.
virtual void KexiTableEdit::setColumnInfo | ( | KexiDB::QueryColumnInfo * | ) | [inline, virtual] |
Implemented for KexiDataItemInterface.
Does nothing because instead KexiTableViewColumn is used to get field's schema.
Implements KexiDataItemInterface.
Definition at line 57 of file kexitableedit.h.
void KexiTableEdit::setupContents | ( | QPainter * | p, | |
bool | focused, | |||
QVariant | val, | |||
QString & | txt, | |||
int & | align, | |||
int & | x, | |||
int & | y_offset, | |||
int & | w, | |||
int & | h | |||
) | [virtual] |
For reimplementation. Sets up anmd 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, it's not needed to paint the text (this is done automatically outside.
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.
Reimplemented in KexiKIconTableEdit, KexiBoolTableEdit, KexiComboBoxTableEdit, KexiDateTableEdit, KexiDateTimeTableEdit, and KexiTimeTableEdit.
Definition at line 132 of file kexitableedit.cpp.
void KexiTableEdit::setViewWidget | ( | QWidget * | v | ) | [protected] |
Sets v as view widget for this editor. The view will be assigned as focus proxy for the editor, its events will be filtered, it will be resized when neede, and so on.
Definition at line 76 of file kexitableedit.cpp.
virtual void KexiTableEdit::showWidget | ( | ) | [inline, virtual] |
Shows item's widget, if available.
Reimplemented from KexiDataItemInterface.
Definition at line 73 of file kexitableedit.h.
virtual QSize KexiTableEdit::totalSize | ( | ) | [inline, virtual] |
- Returns:
- total size of this editor, including any buttons, etc. (if present). Reimpelment this if you want to return more appropriate size. This impelmentation just returns QWidget::size().
Reimplemented in KexiInputTableEdit.
Definition at line 124 of file kexitableedit.h.
virtual QWidget* KexiTableEdit::widget | ( | ) | [inline, virtual] |
- Returns:
- the view widget of this editor, e.g. line edit widget.
Implements KexiDataItemInterface.
Definition at line 67 of file kexitableedit.h.
int KexiTableEdit::widthForValue | ( | QVariant & | val, | |
QFontMetrics & | fm | |||
) | [virtual] |
- Returns:
- width of value. For the default implementation val is converted to a string and width of this string is returned.
Reimplemented in KexiComboBoxTableEdit.
Definition at line 238 of file kexitableedit.cpp.
The documentation for this class was generated from the following files: