kexi
KexiBlobTableEdit Class Reference
Inheritance diagram for KexiBlobTableEdit:

Detailed Description
Definition at line 36 of file kexiblobtableedit.h.
Public Member Functions | |
KexiBlobTableEdit (KexiTableViewColumn &column, QWidget *parent=0) | |
virtual | ~KexiBlobTableEdit () |
bool | valueIsNull () |
bool | valueIsEmpty () |
virtual QVariant | value () |
virtual bool | cursorAtStart () |
virtual bool | cursorAtEnd () |
virtual void | resize (int w, int h) |
virtual void | showFocus (const QRect &r, bool readOnly) |
virtual void | hideFocus () |
virtual QSize | totalSize () const |
virtual void | paintFocusBorders (QPainter *p, QVariant &, int x, int y, int w, int h) |
virtual bool | handleKeyPress (QKeyEvent *ke, bool editorActive) |
virtual bool | handleDoubleClick () |
virtual void | handleAction (const QString &actionName) |
virtual void | handleCopyAction (const QVariant &value, const QVariant &visibleValue) |
virtual void | setupContents (QPainter *p, bool focused, const QVariant &val, QString &txt, int &align, int &x, int &y_offset, int &w, int &h) |
Protected Slots | |
void | slotUpdateActionsAvailabilityRequested (bool &valueIsNull, bool &valueIsReadOnly) |
void | handleInsertFromFileAction (const KURL &url) |
void | handleAboutToSaveAsAction (QString &origFilename, QString &fileExtension, bool &dataIsEmpty) |
void | handleSaveAsAction (const QString &fileName) |
void | handleCutAction () |
void | handleCopyAction () |
void | handlePasteAction () |
virtual void | clear () |
void | handleShowPropertiesAction () |
Protected Member Functions | |
virtual void | setValueInternal (const QVariant &add, bool removeOld) |
void | updateFocus (const QRect &r) |
void | signalEditRequested () |
void | executeCopyAction (const QByteArray &data) |
Protected Attributes | |
Private * | d |
Constructor & Destructor Documentation
KexiBlobTableEdit::KexiBlobTableEdit | ( | KexiTableViewColumn & | column, | |
QWidget * | parent = 0 | |||
) |
Definition at line 83 of file kexiblobtableedit.cpp.
Member Function Documentation
bool KexiBlobTableEdit::valueIsNull | ( | ) | [virtual] |
- Returns:
- true if editor's value is null (not empty) Used for checking if a given constraint within table or form is met.
Implements KexiDataItemInterface.
Definition at line 208 of file kexiblobtableedit.cpp.
bool KexiBlobTableEdit::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 of form is met.
Implements KexiDataItemInterface.
Definition at line 215 of file kexiblobtableedit.cpp.
QVariant KexiBlobTableEdit::value | ( | ) | [virtual] |
- Returns:
- value currently represented by this item.
Implements KexiDataItemInterface.
Definition at line 222 of file kexiblobtableedit.cpp.
bool KexiBlobTableEdit::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 399 of file kexiblobtableedit.cpp.
bool KexiBlobTableEdit::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 404 of file kexiblobtableedit.cpp.
void KexiBlobTableEdit::resize | ( | int | w, | |
int | h | |||
) | [virtual] |
Reimplemented: resizes a view().
Reimplemented from KexiTableEdit.
Definition at line 524 of file kexiblobtableedit.cpp.
void KexiBlobTableEdit::showFocus | ( | const QRect & | r, | |
bool | readOnly | |||
) | [virtual] |
Displays additional elements that are needed for indicating that the current cell is selected. For example, combobox editor (KexiComboBoxTableEdit) moves and shows dropdown button. r is the rectangle for the cell. If readOnly is true, additional elements should be visually disabled, e.g. dropdown button of the combobox editor should be disabled. For reimplementation. By default does nothing.
Reimplemented from KexiDataItemInterface.
Definition at line 512 of file kexiblobtableedit.cpp.
void KexiBlobTableEdit::hideFocus | ( | ) | [virtual] |
Hides additional elements that are needed for indicating that the current cell is selected. For reimplementation. By default does nothing.
Reimplemented from KexiDataItemInterface.
Definition at line 550 of file kexiblobtableedit.cpp.
QSize KexiBlobTableEdit::totalSize | ( | ) | const [virtual] |
- Returns:
- total size of this editor, including popup button.
Definition at line 555 of file kexiblobtableedit.cpp.
void KexiBlobTableEdit::paintFocusBorders | ( | QPainter * | p, | |
QVariant & | , | |||
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 useful if you want to reimplement this method).
Reimplemented from KexiTableEdit.
Definition at line 247 of file kexiblobtableedit.cpp.
bool KexiBlobTableEdit::handleKeyPress | ( | QKeyEvent * | ke, | |
bool | editorActive | |||
) | [virtual] |
Reimplemented to handle the key events.
Reimplemented from KexiTableEdit.
Definition at line 574 of file kexiblobtableedit.cpp.
bool KexiBlobTableEdit::handleDoubleClick | ( | ) | [virtual] |
Handles double click request coming from the table view.
- Returns:
- true if it has been consumed. Reimplemented in KexiBlobTableEdit (to execute "insert file" action.
Reimplemented from KexiTableEdit.
Definition at line 596 of file kexiblobtableedit.cpp.
void KexiBlobTableEdit::handleAction | ( | const QString & | actionName | ) | [virtual] |
Handles action having standard name actionName. Action could be: "edit_cut", "edit_paste", etc.
Reimplemented from KexiDataItemInterface.
Definition at line 608 of file kexiblobtableedit.cpp.
void KexiBlobTableEdit::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.
Implements KexiTableEdit.
Definition at line 602 of file kexiblobtableedit.cpp.
void KexiBlobTableEdit::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 paramaters 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 256 of file kexiblobtableedit.cpp.
void KexiBlobTableEdit::handleInsertFromFileAction | ( | const KURL & | url | ) | [protected, slot] |
Definition at line 409 of file kexiblobtableedit.cpp.
void KexiBlobTableEdit::handleAboutToSaveAsAction | ( | QString & | origFilename, | |
QString & | fileExtension, | |||
bool & | dataIsEmpty | |||
) | [protected, slot] |
Definition at line 435 of file kexiblobtableedit.cpp.
void KexiBlobTableEdit::handleSaveAsAction | ( | const QString & | fileName | ) | [protected, slot] |
Definition at line 443 of file kexiblobtableedit.cpp.
void KexiBlobTableEdit::clear | ( | ) | [protected, virtual, slot] |
clears item's data, so the data will contain NULL data
Implements KexiDataItemInterface.
Definition at line 499 of file kexiblobtableedit.cpp.
void KexiBlobTableEdit::handleShowPropertiesAction | ( | ) | [protected, slot] |
Definition at line 507 of file kexiblobtableedit.cpp.
void KexiBlobTableEdit::setValueInternal | ( | const QVariant & | add, | |
bool | removeOld | |||
) | [protected, virtual] |
initializes this editor with add value
Implements KexiDataItemInterface.
Definition at line 140 of file kexiblobtableedit.cpp.
The documentation for this class was generated from the following files: