KexiDBComboBox Class Reference
#include <kexidbcombobox.h>
Inheritance diagram for KexiDBComboBox:

Detailed Description
Combo box widget for Kexi forms.This widget is implemented on top of KexiDBAutoField, so as it uses KexiDBAutoField's ability of embedding subwidgets, it can display not only a line edit but also text edit or image box (more can be added in the future). A drop-down button is added to mimic native combo box widget's functionality.
Definition at line 34 of file kexidbcombobox.h.
Public Slots | |
| void | slotRowAccepted (KexiTableItem *item, int row) |
| Call this from slot. | |
| void | slotItemSelected (KexiTableItem *item) |
| Call this from slot. | |
Public Member Functions | |
| KexiDBComboBox (QWidget *parent, const char *name=0, bool designMode=true) | |
| virtual | ~KexiDBComboBox () |
| virtual KexiTableViewColumn * | column () const |
| Implemented for KexiComboBoxBase: form has no 'related data' model (only the full database model). | |
| virtual KexiDB::Field * | field () const |
| Implemented for KexiComboBoxBase. | |
| virtual QVariant | origValue () const |
| Implemented for KexiComboBoxBase. | |
| void | setEditable (bool set) |
| bool | isEditable () const |
| virtual void | setLabelPosition (LabelPosition position) |
| virtual QVariant | value () |
| virtual QVariant | visibleValue () |
| virtual bool | valueChanged () |
| Reimpemented because to avoid taking value from the internal editor (index is taken from the popup instead). | |
| virtual QSize | sizeHint () const |
| virtual void | setColumnInfo (KexiDB::QueryColumnInfo *cinfo) |
| Reimplemented after KexiDBAutoField: jsut sets cinfo without initializing a subwidget. | |
| virtual void | setVisibleColumnInfo (KexiDB::QueryColumnInfo *cinfo) |
| virtual KexiDB::QueryColumnInfo * | visibleColumnInfo () const |
| const QColor & | paletteBackgroundColor () const |
| Reimplemented to return internal editor's color. | |
| virtual void | setPaletteBackgroundColor (const QColor &color) |
| Reimplemented to also set 'this' widget's background color, not only subwidget's. | |
| virtual void | undoChanges () |
Protected Slots | |
| void | slotInternalEditorValueChanged (const QVariant &v) |
| Call this from slot. | |
Protected Member Functions | |
| QRect | buttonGeometry () const |
| virtual void | paintEvent (QPaintEvent *) |
| virtual void | mousePressEvent (QMouseEvent *e) |
| void | mouseDoubleClickEvent (QMouseEvent *e) |
| virtual bool | eventFilter (QObject *o, QEvent *e) |
| QRect | editorGeometry () const |
| virtual void | createEditor () |
| Creates editor. | |
| virtual void | styleChange (QStyle &oldStyle) |
| virtual void | fontChange (const QFont &oldFont) |
| virtual bool | subwidgetStretchRequired (KexiDBAutoField *autoField) const |
| virtual QWidget * | internalEditor () const |
| Implemented for KexiComboBoxBase. | |
| virtual void | moveCursorToEndInInternalEditor () |
| Implemented for KexiComboBoxBase. Does nothing if the widget is not editable. | |
| virtual void | selectAllInInternalEditor () |
| Implemented for KexiComboBoxBase. Does nothing if the widget is not editable. | |
| virtual void | setValueInInternalEditor (const QVariant &value) |
| Implemented for KexiComboBoxBase. | |
| virtual QVariant | valueFromInternalEditor () |
| Implemented for KexiComboBoxBase. | |
| virtual void | editRequested () |
| Implemented for KexiComboBoxBase. | |
| virtual void | acceptRequested () |
| Implemented for KexiComboBoxBase. | |
| virtual QPoint | mapFromParentToGlobal (const QPoint &pos) const |
| Implement this to return a position pos mapped from parent (e.g. | |
| virtual int | popupWidthHint () const |
| Implement this to return a hint for popup width. | |
| virtual void | setValueInternal (const QVariant &add, bool removeOld) |
| virtual void | setVisibleValueInternal (const QVariant &value) |
| Implemented to handle visible value instead of index. | |
| bool | handleMousePressEvent (QMouseEvent *e) |
| bool | handleKeyPressEvent (QKeyEvent *ke) |
| virtual void | beforeSignalValueChanged () |
| Implemented for KexiDataItemInterface. | |
| virtual KexiComboBoxPopup * | popup () const |
| virtual void | setPopup (KexiComboBoxPopup *popup) |
| virtual bool | keyPressed (QKeyEvent *ke) |
Protected Attributes | |
| Private *const | d |
Properties | |
| bool | editable |
Constructor & Destructor Documentation
|
||||||||||||||||
|
Definition at line 74 of file kexidbcombobox.cpp. References d, and KexiDBAutoField::setFocusPolicy(). |
|
|
Definition at line 87 of file kexidbcombobox.cpp. References d. |
Member Function Documentation
|
|
Implemented for KexiComboBoxBase.
Implements KexiComboBoxBase. Definition at line 509 of file kexidbcombobox.cpp. References KexiDataItemInterface::signalValueChanged(). |
|
|
Implemented for KexiDataItemInterface.
Reimplemented from KexiDataItemInterface. Definition at line 521 of file kexidbcombobox.cpp. References d, KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget, slotInternalEditorValueChanged(), and KexiDataItemInterface::value(). |
|
|
Definition at line 230 of file kexidbcombobox.cpp. References d. Referenced by eventFilter(), and handleMousePressEvent(). |
|
|
Implemented for KexiComboBoxBase: form has no 'related data' model (only the full database model).
Implements KexiComboBoxBase. Definition at line 50 of file kexidbcombobox.h. |
|
|
Creates editor. Reimplemented, because if the combo box is not editable, editor should not be created. Reimplemented from KexiDBAutoField. Definition at line 180 of file kexidbcombobox.cpp. References KexiDBAutoField::createEditor(), d, editorGeometry(), and KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget. Referenced by setEditable(). |
|
|
Definition at line 169 of file kexidbcombobox.cpp. References d. Referenced by createEditor(), eventFilter(), paintEvent(), setLabelPosition(), and styleChange(). |
|
|
Implemented for KexiComboBoxBase.
Implements KexiComboBoxBase. Definition at line 505 of file kexidbcombobox.cpp. |
|
||||||||||||
|
Reimplemented from KexiDBAutoField. Definition at line 328 of file kexidbcombobox.cpp. References buttonGeometry(), d, editorGeometry(), KexiDBAutoField::eventFilter(), handleKeyPressEvent(), handleMousePressEvent(), KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget, and size. |
|
|
Implemented for KexiComboBoxBase.
Implements KexiComboBoxBase. Definition at line 53 of file kexidbcombobox.h. References KexiFormDataItemInterface::field(). |
|
|
Reimplemented Definition at line 478 of file kexidbcombobox.cpp. References d. |
|
|
Definition at line 269 of file kexidbcombobox.cpp. References KexiComboBoxBase::acceptPopupSelection(), d, KexiComboBoxBase::handleKeyPressForPopup(), popup(), and KexiComboBoxBase::showPopup(). Referenced by eventFilter(). |
|
|
Definition at line 239 of file kexidbcombobox.cpp. References buttonGeometry(), d, isEditable(), and KexiComboBoxBase::showPopup(). Referenced by eventFilter(), and mousePressEvent(). |
|
|
Implemented for KexiComboBoxBase.
Implements KexiComboBoxBase. Definition at line 129 of file kexidbcombobox.h. |
|
|
Definition at line 117 of file kexidbcombobox.cpp. References d. Referenced by handleMousePressEvent(). |
|
|
Called by top-level form on key press event. Used for Key_Escape to if the popup is visible, so the key press won't be consumed to perform "cancel editing". Reimplemented from KexiDBAutoField. Definition at line 297 of file kexidbcombobox.cpp. References KexiDBAutoField::keyPressed(), and popup(). |
|
|
Implement this to return a position pos mapped from parent (e.g. viewport) to global coordinates. QPoint(-1, -1) should be returned if this cannot be computed. Implements KexiComboBoxBase. Definition at line 465 of file kexidbcombobox.cpp. |
|
|
Definition at line 323 of file kexidbcombobox.cpp. References mousePressEvent(). |
|
|
Definition at line 312 of file kexidbcombobox.cpp. References handleMousePressEvent(). Referenced by mouseDoubleClickEvent(). |
|
|
Implemented for KexiComboBoxBase. Does nothing if the widget is not editable.
Implements KexiComboBoxBase. Definition at line 420 of file kexidbcombobox.cpp. References d, KexiComboBoxBase::m_moveCursorToEndInInternalEditor_enabled, and KexiDBAutoField::moveCursorToEnd(). |
|
|
Implemented for KexiComboBoxBase.
Implements KexiComboBoxBase. Definition at line 56 of file kexidbcombobox.h. |
|
|
Definition at line 122 of file kexidbcombobox.cpp. References d, editorGeometry(), and paletteBackgroundColor(). |
|
|
Reimplemented to return internal editor's color.
Reimplemented from KexiDBAutoField. Definition at line 84 of file kexidbcombobox.h. References KexiDBAutoField::paletteBackgroundColor(). Referenced by paintEvent(). |
|
|
Implements KexiComboBoxBase. Definition at line 92 of file kexidbcombobox.cpp. References d. Referenced by handleKeyPressEvent(), and keyPressed(). |
|
|
Implement this to return a hint for popup width.
Implements KexiComboBoxBase. Definition at line 473 of file kexidbcombobox.cpp. |
|
|
Implemented for KexiComboBoxBase. Does nothing if the widget is not editable.
Implements KexiComboBoxBase. Definition at line 426 of file kexidbcombobox.cpp. References d, KexiComboBoxBase::m_selectAllInInternalEditor_enabled, and KexiDBAutoField::selectAll(). |
|
|
Reimplemented after KexiDBAutoField: jsut sets cinfo without initializing a subwidget. Initialization is performed by setVisibleColumnInfo(). Reimplemented from KexiDBAutoField. Definition at line 403 of file kexidbcombobox.cpp. References KexiFormDataItemInterface::setColumnInfo(). |
|
|
Definition at line 102 of file kexidbcombobox.cpp. References createEditor(), d, and KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget. |
|
|
Reimplemented from KexiDBAutoField. Definition at line 209 of file kexidbcombobox.cpp. References editorGeometry(), KexiDBAutoField::Left, and KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget. |
|
|
Reimplemented to also set 'this' widget's background color, not only subwidget's.
Reimplemented from KexiDBAutoField. Definition at line 384 of file kexidbcombobox.cpp. References KexiDBAutoField::setPaletteBackgroundColor(). |
|
|
Implements KexiComboBoxBase. Definition at line 97 of file kexidbcombobox.cpp. References d. |
|
|
Implemented for KexiComboBoxBase. removeOld Implements KexiComboBoxBase. Definition at line 451 of file kexidbcombobox.cpp. References KexiComboBoxBase::m_setValueInInternalEditor_enabled, KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget, and KexiDataItemInterface::setValue(). |
|
||||||||||||
|
Initializes this editor with add value, which should be somewhat added to the current value (already storted in m_origValue). If removeOld is true, a value should be set to add, otherwise -it should be set to current m_origValue + add, if possible. Implement this. Reimplemented from KexiDBAutoField. Definition at line 432 of file kexidbcombobox.cpp. References KexiComboBoxBase::setValueInternal(). |
|
|
Used internally to set visible database column information. Reimplemented: performs initialization of the subwidget. Reimplemented from KexiFormDataItemInterface. Definition at line 408 of file kexidbcombobox.cpp. References KexiFormDataItemInterface::columnInfo(), d, and KexiDBAutoField::setColumnInfoInternal(). |
|
|
Implemented to handle visible value instead of index. removeOld Reimplemented from KexiDataItemInterface. Definition at line 439 of file kexidbcombobox.cpp. References KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget, and KexiDataItemInterface::setValue(). |
|
|
Reimplemented from KexiDBAutoField. Definition at line 492 of file kexidbcombobox.cpp. References d. |
|
|
Call this from slot.
Reimplemented from KexiComboBoxBase. Definition at line 99 of file kexidbcombobox.h. References KexiComboBoxBase::slotInternalEditorValueChanged(). Referenced by beforeSignalValueChanged(). |
|
|
Call this from slot.
Reimplemented from KexiComboBoxBase. Definition at line 96 of file kexidbcombobox.h. References KexiComboBoxBase::slotItemSelected(). |
|
||||||||||||
|
Call this from slot.
Reimplemented from KexiComboBoxBase. Definition at line 514 of file kexidbcombobox.cpp. References d, and KexiComboBoxBase::slotRowAccepted(). |
|
|
Reimplemented Definition at line 484 of file kexidbcombobox.cpp. References d, editorGeometry(), and KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget. |
|
|
Definition at line 378 of file kexidbcombobox.cpp. |
|
|
Undoes changes made to this item - just resets the widget to original value. Reimplemented after KexiFormDataItemInterface to also revert the visible value (i.e. text) to the original state. Reimplemented from KexiComboBoxBase. Definition at line 531 of file kexidbcombobox.cpp. References KexiComboBoxBase::undoChanges(), and KexiFormDataItemInterface::undoChanges(). |
|
|
Reimplemented from KexiDBAutoField. Definition at line 63 of file kexidbcombobox.h. References KexiComboBoxBase::value(). Referenced by valueChanged(). |
|
|
Reimpemented because to avoid taking value from the internal editor (index is taken from the popup instead).
Reimplemented from KexiDBAutoField. Definition at line 396 of file kexidbcombobox.cpp. References KexiDataItemInterface::m_origValue, and value(). |
|
|
Implemented for KexiComboBoxBase.
Implements KexiComboBoxBase. Definition at line 460 of file kexidbcombobox.cpp. References KexiDBAutoField::value(). |
|
|
Reimplemented from KexiFormDataItemInterface. Definition at line 415 of file kexidbcombobox.cpp. References d. |
|
|
Reimplemented from KexiComboBoxBase. Definition at line 446 of file kexidbcombobox.cpp. References KexiComboBoxBase::visibleValue(). |
Member Data Documentation
|
|
Reimplemented from KexiDBAutoField. Definition at line 176 of file kexidbcombobox.h. Referenced by beforeSignalValueChanged(), buttonGeometry(), createEditor(), editorGeometry(), eventFilter(), fontChange(), handleKeyPressEvent(), handleMousePressEvent(), isEditable(), KexiDBComboBox(), moveCursorToEndInInternalEditor(), paintEvent(), popup(), selectAllInInternalEditor(), setEditable(), setPopup(), setVisibleColumnInfo(), sizeHint(), slotRowAccepted(), styleChange(), visibleColumnInfo(), and ~KexiDBComboBox(). |
Property Documentation
|
|
Definition at line 38 of file kexidbcombobox.h. |
The documentation for this class was generated from the following files:
