kexi
KexiComboBoxTableEdit Class Reference
Inheritance diagram for KexiComboBoxTableEdit:

Detailed Description
Definition at line 36 of file kexicomboboxtableedit.h.
Public Member Functions | |
KexiComboBoxTableEdit (KexiTableViewColumn &column, QScrollView *parent=0) | |
virtual | ~KexiComboBoxTableEdit () |
virtual QVariant | value () |
virtual void | clear () |
virtual bool | valueChanged () |
virtual bool | valueIsNull () |
virtual bool | valueIsEmpty () |
virtual void | resize (int w, int h) |
virtual void | showFocus (const QRect &r, bool readOnly) |
virtual void | hideFocus () |
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 bool | handleKeyPress (QKeyEvent *ke, bool editorActive) |
virtual int | widthForValue (QVariant &val, QFontMetrics &fm) |
virtual void | hide () |
virtual void | show () |
virtual QSize | totalSize () const |
Protected Slots | |
void | slotButtonClicked () |
void | showPopup () |
void | slotRowAccepted (KexiTableItem *item, int row) |
void | slotItemSelected (KexiTableItem *) |
void | slotLineEditTextChanged (const QString &newtext) |
void | slotPopupHidden () |
Protected Member Functions | |
void | updateFocus (const QRect &r) |
virtual void | setValueInternal (const QVariant &add, bool removeOld) |
virtual bool | eventFilter (QObject *o, QEvent *e) |
void | updateTextForHighlightedRow () |
QString | valueForString (const QString &str, uint lookInColumn, uint returnFromColumn, bool allowNulls=false) |
void | setLineEditText (const QString &text) |
Protected Attributes | |
Private * | d |
Member Function Documentation
void KexiComboBoxTableEdit::clear | ( | ) | [virtual] |
clears item's data, so the data will contain NULL data
Reimplemented from KexiInputTableEdit.
Definition at line 340 of file kexicomboboxtableedit.cpp.
bool KexiComboBoxTableEdit::handleKeyPress | ( | QKeyEvent * | ke, | |
bool | editorActive | |||
) | [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 from KexiTableEdit.
Definition at line 525 of file kexicomboboxtableedit.cpp.
void KexiComboBoxTableEdit::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 290 of file kexicomboboxtableedit.cpp.
void KexiComboBoxTableEdit::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 from KexiTableEdit.
Definition at line 384 of file kexicomboboxtableedit.cpp.
void KexiComboBoxTableEdit::resize | ( | int | w, | |
int | h | |||
) | [virtual] |
Reimplemented: resizes a view().
Reimplemented from KexiTableEdit.
Definition at line 257 of file kexicomboboxtableedit.cpp.
void KexiComboBoxTableEdit::setLineEditText | ( | const QString & | text | ) | [protected] |
sets text for the line edit without setting a flag (d->userEnteredText) that indicates that the text has been entered by hand (by a user)
Definition at line 675 of file kexicomboboxtableedit.cpp.
void KexiComboBoxTableEdit::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 from KexiTableEdit.
Definition at line 392 of file kexicomboboxtableedit.cpp.
void KexiComboBoxTableEdit::setValueInternal | ( | const QVariant & | add, | |
bool | removeOld | |||
) | [protected, virtual] |
initializes this editor with add value
- Todo:
- precision!
- Todo:
- (js): get decimal places settings here...
Reimplemented from KexiInputTableEdit.
Definition at line 156 of file kexicomboboxtableedit.cpp.
void KexiComboBoxTableEdit::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 249 of file kexicomboboxtableedit.cpp.
QSize KexiComboBoxTableEdit::totalSize | ( | ) | const [virtual] |
- Returns:
- total size of this editor, including popup button.
Definition at line 670 of file kexicomboboxtableedit.cpp.
void KexiComboBoxTableEdit::updateFocus | ( | const QRect & | r | ) | [protected] |
QVariant KexiComboBoxTableEdit::value | ( | ) | [virtual] |
Note: Generally in current implementation this is integer > 0; may be null if no value is set.
Reimplemented from KexiInputTableEdit.
Definition at line 295 of file kexicomboboxtableedit.cpp.
bool KexiComboBoxTableEdit::valueChanged | ( | ) | [virtual] |
- Returns:
- true if editor's value is changed (compared to original value)
Reimplemented from KexiInputTableEdit.
Definition at line 347 of file kexicomboboxtableedit.cpp.
QString KexiComboBoxTableEdit::valueForString | ( | const QString & | str, | |
uint | lookInColumn, | |||
uint | returnFromColumn, | |||
bool | allowNulls = false | |||
) | [protected] |
- Returns:
- value from returnFromColumn related to str value from column lookInColumn. If allowNulls is true, NULL is returend if no matched column found, else: str is returned. Example: lookInColumn=0, returnFromColumn=1 --returns user-visible string for column #1 for id-column #0
Definition at line 221 of file kexicomboboxtableedit.cpp.
bool KexiComboBoxTableEdit::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()),
Reimplemented from KexiInputTableEdit.
Definition at line 379 of file kexicomboboxtableedit.cpp.
bool KexiComboBoxTableEdit::valueIsNull | ( | ) | [virtual] |
- Returns:
- true if editor's value is null (not empty)
Reimplemented from KexiInputTableEdit.
Definition at line 371 of file kexicomboboxtableedit.cpp.
int KexiComboBoxTableEdit::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 from KexiTableEdit.
Definition at line 645 of file kexicomboboxtableedit.cpp.
The documentation for this class was generated from the following files: