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

Detailed Description
Abstract class for a cell editor. Handles cell painting and displaying the editor widget.
Definition at line 39 of file kexitableedit.h.
Signals | |
| void | editRequested () |
| void | cancelRequested () |
| void | acceptRequested () |
Public Member Functions | |
| KexiTableEdit (KexiTableViewColumn &column, QWidget *parent=0) | |
| virtual | ~KexiTableEdit () |
| virtual KexiDB::Field * | field () const |
| Implemented for KexiDataItemInterface. | |
| virtual KexiDB::QueryColumnInfo * | columnInfo () const |
| virtual void | setColumnInfo (KexiDB::QueryColumnInfo *) |
| Implemented for KexiDataItemInterface. | |
| KexiTableViewColumn * | column () const |
| KexiDB::Field * | displayedField () 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, const QVariant &val, QString &txt, int &align, int &x, int &y_offset, int &w, int &h) |
| bool | usesSelectedTextColor () const |
| virtual void | paintSelectionBackground (QPainter *p, bool focused, const QString &txt, int align, int x, int y_offset, int w, int h, const QColor &fillColor, const QFontMetrics &fm, bool readOnly, bool fullRowSelection) |
| int | leftMargin () const |
| int | rightMargin (bool focused) const |
| virtual bool | handleKeyPress (QKeyEvent *ke, bool editorActive) |
| virtual bool | handleDoubleClick () |
| virtual void | handleCopyAction (const QVariant &value, const QVariant &visibleValue)=0 |
| virtual int | widthForValue (QVariant &val, const QFontMetrics &fm) |
| virtual QSize | totalSize () |
| virtual bool | showToolTipIfNeeded (const QVariant &value, const QRect &rect, const QFontMetrics &fm, bool focused) |
| virtual void | createInternalEditor (KexiDB::QuerySchema &schema) |
Protected Member Functions | |
| virtual bool | eventFilter (QObject *watched, QEvent *e) |
| void | setViewWidget (QWidget *v) |
| void | moveChild (QWidget *child, int x, int y) |
| void | repaintRelatedCell () |
Protected Attributes | |
| KexiTableViewColumn * | m_column |
| int | m_leftMargin |
| int | m_rightMargin |
| int | m_rightMarginWhenFocused |
| QScrollView * | m_scrollView |
| may be 0 if the parent is not a scrollview | |
| bool | m_usesSelectedTextColor: 1 |
| set in ctor, | |
Constructor & Destructor Documentation
|
||||||||||||
|
Definition at line 33 of file kexitableedit.cpp. References displayedField(), m_leftMargin, m_rightMargin, and m_rightMarginWhenFocused. |
|
|
Definition at line 74 of file kexitableedit.cpp. |
Member Function Documentation
|
|
Reimplemented in KexiComboBoxTableEdit. Referenced by KexiComboBoxTableEdit::acceptRequested(). |
|
|
|
|
|
Reimplemented in KexiComboBoxTableEdit. Definition at line 62 of file kexitableedit.h. |
|
|
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 54 of file kexitableedit.h. Referenced by KexiTableView::getVisibleLookupValue(). |
|
|
Created internal editor for this editor is needed. This method is only implemented in KexiComboBoxTableEdit since it's visible value differs from internal value, so a different KexiTableEdit object is used to displaying the data. Reimplemented in KexiComboBoxTableEdit. Definition at line 172 of file kexitableedit.h. |
|
|
Definition at line 78 of file kexitableedit.cpp. References KexiTableViewColumn::field(), KexiDB::QueryColumnInfo::field, m_column, and KexiTableViewColumn::visibleLookupColumnInfo. Referenced by KexiInputTableEdit::init(), KexiTableEdit(), KexiTableViewCellToolTip::maybeTip(), and setupContents(). |
|
|
||||||||||||
|
Reimplemented in KexiComboBoxTableEdit. Definition at line 112 of file kexitableedit.cpp. |
|
|
Implemented for KexiDataItemInterface.
Implements KexiDataItemInterface. Reimplemented in KexiComboBoxTableEdit. Definition at line 50 of file kexitableedit.h. Referenced by KexiBoolTableEdit::clear(), KexiBoolTableEdit::clickedOnContents(), KexiBoolTableEdit::handleAction(), KexiInputTableEdit::init(), KexiBoolTableEdit::KexiBoolTableEdit(), KexiInputTableEdit::setValueInternal(), and KexiInputTableEdit::value(). |
|
||||||||||||
|
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. For a special case (combo box), visibleValue can be provided, so it can be copied to the clipboard instead of unreadable value. For reimplementation. Implemented in KexiBlobTableEdit, KexiKIconTableEdit, KexiBoolTableEdit, KexiComboBoxTableEdit, KexiDateTableEdit, KexiDateTimeTableEdit, KexiInputTableEdit, and KexiTimeTableEdit. Referenced by KexiTableView::copySelection(). |
|
|
Handles double click request coming from the table view.
Reimplemented in KexiBlobTableEdit. Definition at line 142 of file kexitableedit.h. Referenced by KexiTableView::contentsMouseDoubleClickEvent(). |
|
||||||||||||
|
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 KexiBlobTableEdit, and KexiComboBoxTableEdit. Definition at line 136 of file kexitableedit.h. Referenced by KexiTableView::eventFilter(), and KexiTableView::keyPressEvent(). |
|
|
Hides item's widget, if available. Reimplemented from KexiDataItemInterface. Definition at line 78 of file kexitableedit.h. |
|
|
Sometimes, editor can contain non-standard margin, for example combobox editor contains dropdown button at the right side.
Definition at line 125 of file kexitableedit.h. Referenced by KexiTableView::adjustColumnWidthToContents(), KexiTableView::paintCell(), and KexiInputTableEdit::showToolTipIfNeeded(). |
|
||||||||||||||||
|
Moves child widget within the viewport if the parent is scrollview (otherwise does nothing). Use this for child widgets that are outside of this editor widget, instead of calling QWidget::move(). Definition at line 94 of file kexitableedit.cpp. References m_scrollView. Referenced by KexiComboBoxTableEdit::updateFocus(), and KexiBlobTableEdit::updateFocus(). |
|
||||||||||||||||||||||||||||
|
Paints a border for the cell described by x, y, w, h on p painter. The cell's value is val (may be useful if you want to reimplement this method). Reimplemented in KexiBlobTableEdit, and KexiComboBoxTableEdit. Definition at line 143 of file kexitableedit.cpp. |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
For reimplementation. Paints selection's background using p. Most parameters are similar to these from setupContents(). Definition at line 188 of file kexitableedit.cpp. |
|
|
Allows to force redrawing the related cell by the editor itself. Usable when the editor is not displayed by a QWidget but rather by table view cell itself, for example KexiBlobTableEdit. Definition at line 216 of file kexitableedit.cpp. References m_scrollView. Referenced by KexiBlobTableEdit::clear(), KexiBoolTableEdit::handleAction(), and KexiBlobTableEdit::handlePasteAction(). |
|
||||||||||||
|
Reimplemented: resizes a view(). Reimplemented in KexiBlobTableEdit, and KexiComboBoxTableEdit. Definition at line 100 of file kexitableedit.cpp. |
|
|
Sometimes, editor can contain non-standard margin, for example combobox editor contains dropdown button at the right side. THe dropdown button's width is counted only if focused is true.
Definition at line 232 of file kexitableedit.cpp. References m_rightMargin, and m_rightMarginWhenFocused. Referenced by KexiTableView::adjustColumnWidthToContents(), and KexiInputTableEdit::showToolTipIfNeeded(). |
|
|
Implemented for KexiDataItemInterface. Does nothing because instead KexiTableViewColumn is used to get field's schema. Implements KexiDataItemInterface. Definition at line 58 of file kexitableedit.h. |
|
||||||||||||||||||||||||||||||||||||||||
|
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. Reimplemented in KexiBlobTableEdit, KexiKIconTableEdit, KexiBoolTableEdit, KexiComboBoxTableEdit, KexiDateTableEdit, KexiDateTimeTableEdit, and KexiTimeTableEdit. Definition at line 148 of file kexitableedit.cpp. References displayedField(), KexiDB::formatNumberForVisibleDecimalPlaces(), KexiDB::Field::isFPNumericType(), KexiDB::Field::isIntegerType(), and KexiDB::Field::visibleDecimalPlaces(). Referenced by KexiTableViewCellToolTip::maybeTip(), and KexiComboBoxTableEdit::setupContents(). |
|
|
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 86 of file kexitableedit.cpp. Referenced by KexiInputTableEdit::init(), and KexiBlobTableEdit::setValueInternal(). |
|
||||||||||||||||||||
|
Shows a special tooltip for value if needed, i.e. if the value could not fit inside rect for a given font metrics fm.
Reimplemented in KexiInputTableEdit. Definition at line 222 of file kexitableedit.cpp. Referenced by KexiTableViewCellToolTip::maybeTip(). |
|
|
Shows item's widget, if available. Reimplemented from KexiDataItemInterface. Definition at line 81 of file kexitableedit.h. |
|
|
Reimplemented in KexiInputTableEdit. Definition at line 158 of file kexitableedit.h. References size. Referenced by KexiComboBoxPopup::updateSize(). |
|
|
Definition at line 113 of file kexitableedit.h. Referenced by KexiTableView::paintCell(). |
|
|
Implements KexiDataItemInterface. Definition at line 75 of file kexitableedit.h. |
|
||||||||||||
|
Reimplemented in KexiBoolTableEdit, and KexiComboBoxTableEdit. Definition at line 211 of file kexitableedit.cpp. Referenced by KexiTableView::adjustColumnWidthToContents(). |
Member Data Documentation
|
|
Definition at line 194 of file kexitableedit.h. Referenced by KexiComboBoxTableEdit::column(), KexiComboBoxTableEdit::createInternalEditor(), displayedField(), and KexiComboBoxTableEdit::field(). |
|
|
Definition at line 195 of file kexitableedit.h. Referenced by KexiTableEdit(), and KexiComboBoxTableEdit::popupWidthHint(). |
|
|
Definition at line 196 of file kexitableedit.h. Referenced by KexiTableEdit(), KexiComboBoxTableEdit::resize(), KexiBlobTableEdit::resize(), and rightMargin(). |
|
|
Definition at line 196 of file kexitableedit.h. Referenced by KexiTableEdit(), KexiComboBoxTableEdit::popupWidthHint(), KexiComboBoxTableEdit::resize(), KexiBlobTableEdit::resize(), and rightMargin(). |
|
|
may be 0 if the parent is not a scrollview
Definition at line 197 of file kexitableedit.h. Referenced by KexiComboBoxTableEdit::eventFilter(), KexiComboBoxTableEdit::mapFromParentToGlobal(), moveChild(), repaintRelatedCell(), KexiComboBoxTableEdit::resize(), and KexiBlobTableEdit::resize(). |
|
|
set in ctor,
Definition at line 198 of file kexitableedit.h. Referenced by KexiBoolTableEdit::KexiBoolTableEdit(). |
The documentation for this class was generated from the following files:
