#include <kexidbcombobox.h>
Public Slots | |
| void | slotRowAccepted (KexiTableItem *item, int row) |
| void | slotItemSelected (KexiTableItem *item) |
Public Slots inherited from KexiDBAutoField | |
| virtual void | unsetPalette () |
Public Member Functions | |
| KexiDBComboBox (TQWidget *parent, const char *name=0, bool designMode=true) | |
| virtual KexiTableViewColumn * | column () const |
| virtual KexiDB::Field * | field () const |
| virtual TQVariant | origValue () const |
| void | setEditable (bool set) |
| bool | isEditable () const |
| virtual void | setLabelPosition (LabelPosition position) |
| virtual TQVariant | value () |
| virtual TQVariant | visibleValue () |
| virtual bool | valueChanged () |
| virtual TQSize | sizeHint () const |
| virtual void | setColumnInfo (KexiDB::QueryColumnInfo *cinfo) |
| virtual void | setVisibleColumnInfo (KexiDB::QueryColumnInfo *cinfo) |
| virtual KexiDB::QueryColumnInfo * | visibleColumnInfo () const |
| const TQColor & | paletteBackgroundColor () const |
| virtual void | setPaletteBackgroundColor (const TQColor &color) |
| virtual void | undoChanges () |
Public Member Functions inherited from KexiDBAutoField | |
| KexiDBAutoField (const TQString &text, WidgetType type, LabelPosition pos, TQWidget *parent=0, const char *name=0, bool designMode=true) | |
| KexiDBAutoField (TQWidget *parent=0, const char *name=0, bool designMode=true, LabelPosition pos=Left) | |
| TQString | dataSource () const |
| TQCString | dataSourceMimeType () const |
| virtual void | setDataSource (const TQString &ds) |
| virtual void | setDataSourceMimeType (const TQCString &ds) |
| virtual void | setInvalidState (const TQString &text) |
| virtual bool | isReadOnly () const |
| virtual void | setReadOnly (bool readOnly) |
| virtual bool | valueIsNull () |
| virtual bool | valueIsEmpty () |
| virtual bool | valueIsValid () |
| virtual void | clear () |
| virtual void | installListener (KexiDataItemChangesListener *listener) |
| WidgetType | widgetType () const |
| void | setWidgetType (WidgetType type) |
| LabelPosition | labelPosition () const |
| TQString | caption () const |
| void | setCaption (const TQString &caption) |
| bool | hasAutoCaption () const |
| void | setAutoCaption (bool autoCaption) |
| virtual void | setDisplayDefaultValue (TQWidget *widget, bool displayDefaultValue) |
| TQWidget * | editor () const |
| TQLabel * | label () const |
| virtual bool | cursorAtStart () |
| virtual bool | cursorAtEnd () |
| void | setFieldTypeInternal (int kexiDBFieldType) |
| void | setFieldCaptionInternal (const TQString &text) |
| int | fieldTypeInternal () const |
| TQString | fieldCaptionInternal () const |
| virtual void | setFocusPolicy (TQWidget::FocusPolicy policy) |
| const TQColor & | paletteForegroundColor () const |
| void | setPaletteForegroundColor (const TQColor &color) |
| const TQColor & | paletteBackgroundColor () const |
| const TQColor & | foregroundLabelColor () const |
| virtual void | setForegroundLabelColor (const TQColor &color) |
| const TQColor & | backgroundLabelColor () const |
| virtual void | setBackgroundLabelColor (const TQColor &color) |
| virtual TQVariant | property (const char *name) const |
| virtual bool | setProperty (const char *name, const TQVariant &value) |
Public Member Functions inherited from KexiFormDataItemInterface | |
| TQString | dataSource () const |
| void | setDataSource (const TQString &ds) |
| TQCString | dataSourceMimeType () const |
| void | setDataSourceMimeType (const TQCString &ds) |
| virtual bool | hasDisplayedDefaultValue () const |
| virtual TQWidget * | widget () |
| virtual KexiDB::QueryColumnInfo * | columnInfo () const |
| virtual void | hideWidget () |
| virtual void | showWidget () |
| void | cancelEditor () |
Public Member Functions inherited from KexiDataItemInterface | |
| void | setValue (const TQVariant &value, const TQVariant &add=TQVariant(), bool removeOld=false, const TQVariant *visibleValue=0) |
| virtual void | moveCursorToEnd () |
| virtual void | moveCursorToStart () |
| virtual void | selectAll () |
| bool | hasFocusableWidget () const |
| virtual void | showFocus (const TQRect &r, bool readOnly) |
| virtual void | hideFocus () |
| virtual void | clickedOnContents () |
| bool | acceptEditorAfterDeleteContents () const |
| virtual void | setFocus () |
| bool | cursorAtNewRow () |
| void | setParentDataItemInterface (KexiDataItemInterface *parentDataItemInterface) |
| KexiDataItemInterface * | parentInterface () const |
| virtual void | handleAction (const TQString &actionName) |
Public Member Functions inherited from KFormDesigner::WidgetWithSubpropertiesInterface | |
| void | setSubwidget (TQWidget *widget) |
| TQWidget * | subwidget () const |
| TQValueList< TQCString > | subproperies () const |
| const TQMetaProperty * | findMetaSubproperty (const char *name) const |
| TQVariant | subproperty (const char *name, bool &ok) const |
| bool | setSubproperty (const char *name, const TQVariant &value) |
Public Member Functions inherited from KexiComboBoxBase | |
| virtual void | clear () |
| virtual tristate | valueChangedInternal () |
| virtual bool | valueIsNull () |
| virtual bool | valueIsEmpty () |
| virtual void | hide () |
| void | createPopup (bool show) |
| void | showPopup () |
| virtual void | slotRowAccepted (KexiTableItem *item, int row) |
| virtual void | slotItemSelected (KexiTableItem *) |
| void | slotInternalEditorValueChanged (const TQVariant &v) |
Protected Slots | |
| void | slotInternalEditorValueChanged (const TQVariant &v) |
Protected Slots inherited from KexiDBAutoField | |
| virtual void | paletteChange (const TQPalette &oldPal) |
| virtual void | moveCursorToEnd () |
| virtual void | moveCursorToStart () |
| virtual void | selectAll () |
Protected Member Functions | |
| TQRect | buttonGeometry () const |
| virtual void | paintEvent (TQPaintEvent *) |
| virtual void | mousePressEvent (TQMouseEvent *e) |
| void | mouseDoubleClickEvent (TQMouseEvent *e) |
| virtual bool | eventFilter (TQObject *o, TQEvent *e) |
| TQRect | editorGeometry () const |
| virtual void | createEditor () |
| virtual void | styleChange (TQStyle &oldStyle) |
| virtual void | fontChange (const TQFont &oldFont) |
| virtual bool | subwidgetStretchRequired (KexiDBAutoField *autoField) const |
| virtual TQWidget * | internalEditor () const |
| virtual void | moveCursorToEndInInternalEditor () |
| virtual void | selectAllInInternalEditor () |
| virtual void | setValueInInternalEditor (const TQVariant &value) |
| virtual TQVariant | valueFromInternalEditor () |
| virtual void | editRequested () |
| virtual void | acceptRequested () |
| virtual TQPoint | mapFromParentToGlobal (const TQPoint &pos) const |
| virtual int | popupWidthHint () const |
| virtual void | setValueInternal (const TQVariant &add, bool removeOld) |
| virtual void | setVisibleValueInternal (const TQVariant &value) |
| bool | handleMousePressEvent (TQMouseEvent *e) |
| bool | handleKeyPressEvent (TQKeyEvent *ke) |
| virtual void | beforeSignalValueChanged () |
| virtual KexiComboBoxPopup * | popup () const |
| virtual void | setPopup (KexiComboBoxPopup *popup) |
| virtual bool | keyPressed (TQKeyEvent *ke) |
Protected Member Functions inherited from KexiDBAutoField | |
| void | init (const TQString &text, WidgetType type, LabelPosition pos) |
| void | changeText (const TQString &text, bool beautify=true) |
| void | updateInformationAboutUnboundField () |
| void | copyPropertiesToEditor () |
| void | setLabelPositionInternal (LabelPosition position, bool noLabel) |
| void | setColumnInfoInternal (KexiDB::QueryColumnInfo *cinfo, KexiDB::QueryColumnInfo *visibleColumnInfo) |
Protected Member Functions inherited from KexiDataItemInterface | |
| virtual void | signalValueChanged () |
| KexiDataItemChangesListener * | listener () |
Protected Member Functions inherited from KFormDesigner::DesignTimeDynamicChildWidgetHandler | |
| void | childWidgetAdded (TQWidget *w) |
| void | assignItem (ObjectTreeItem *item) |
Protected Member Functions inherited from KexiComboBoxBase | |
| KexiTableItem * | selectItemForEnteredValueInLookupTable (const TQVariant &v) |
| TQString | valueForString (const TQString &str, int *row, uint lookInColumn, uint returnFromColumn, bool allowNulls=false) |
| void | setValueOrTextInInternalEditor (const TQVariant &value) |
| KexiDB::LookupFieldSchema * | lookupFieldSchema () const |
| int | rowToHighlightForLookupTable () const |
| virtual void | updateButton () |
| virtual TQVariant | visibleValueForLookupField () |
| void | updateTextForHighlightedRow () |
| bool | handleKeyPressForPopup (TQKeyEvent *ke) |
| void | acceptPopupSelection () |
| void | undoChanges () |
Additional Inherited Members | |
Public Types inherited from KexiDBAutoField | |
| enum | WidgetType { Auto = 100 , Text , Integer , Double , Boolean , Date , Time , DateTime , MultiLineText , ComboBox , Image } |
| enum | LabelPosition { Left = 300 , Top , NoLabel } |
Static Public Member Functions inherited from KexiDBAutoField | |
| static WidgetType | widgetTypeForFieldType (KexiDB::Field::Type type) |
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.
Constructor & Destructor Documentation
◆ KexiDBComboBox()
| KexiDBComboBox::KexiDBComboBox | ( | TQWidget * | parent, |
| const char * | name = 0, |
||
| bool | designMode = true |
||
| ) |
Definition at line 75 of file kexidbcombobox.cpp.
◆ ~KexiDBComboBox()
|
virtual |
Definition at line 89 of file kexidbcombobox.cpp.
Member Function Documentation
◆ acceptRequested()
|
protectedvirtual |
Implemented for KexiComboBoxBase.
Implements KexiComboBoxBase.
Definition at line 521 of file kexidbcombobox.cpp.
◆ beforeSignalValueChanged()
|
protectedvirtual |
Implemented for KexiDataItemInterface.
Reimplemented from KexiDataItemInterface.
Definition at line 533 of file kexidbcombobox.cpp.
◆ buttonGeometry()
|
protected |
Definition at line 231 of file kexidbcombobox.cpp.
◆ column()
|
inlinevirtual |
Implemented for KexiComboBoxBase: form has no 'related data' model (only the full database model)
Implements KexiComboBoxBase.
Definition at line 51 of file kexidbcombobox.h.
◆ createEditor()
|
protectedvirtual |
Creates editor.
Reimplemented, because if the combo box is not editable, editor should not be created.
Reimplemented from KexiDBAutoField.
Definition at line 182 of file kexidbcombobox.cpp.
◆ editorGeometry()
|
protected |
- Returns
- internal editor's geometry
Definition at line 171 of file kexidbcombobox.cpp.
◆ editRequested()
|
protectedvirtual |
Implemented for KexiComboBoxBase.
Implements KexiComboBoxBase.
Definition at line 517 of file kexidbcombobox.cpp.
◆ eventFilter()
|
protectedvirtual |
Reimplemented from KexiDBAutoField.
Definition at line 331 of file kexidbcombobox.cpp.
◆ field()
|
inlinevirtual |
Implemented for KexiComboBoxBase.
Reimplemented from KexiFormDataItemInterface.
Definition at line 54 of file kexidbcombobox.h.
◆ fontChange()
|
protectedvirtual |
Reimplemented
Definition at line 490 of file kexidbcombobox.cpp.
◆ handleKeyPressEvent()
|
protected |
Definition at line 270 of file kexidbcombobox.cpp.
◆ handleMousePressEvent()
|
protected |
Definition at line 240 of file kexidbcombobox.cpp.
◆ internalEditor()
|
inlineprotectedvirtual |
Implemented for KexiComboBoxBase.
Implements KexiComboBoxBase.
Definition at line 130 of file kexidbcombobox.h.
◆ isEditable()
| bool KexiDBComboBox::isEditable | ( | ) | const |
Definition at line 119 of file kexidbcombobox.cpp.
◆ keyPressed()
|
protectedvirtual |
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". Also used for grabbing page down/up keys.
Reimplemented from KexiDBAutoField.
Definition at line 298 of file kexidbcombobox.cpp.
◆ mapFromParentToGlobal()
|
protectedvirtual |
Implement this to return a position pos mapped from parent (e.g.
viewport) to global coordinates. TQPoint(-1, -1) should be returned if this cannot be computed.
Implements KexiComboBoxBase.
Definition at line 476 of file kexidbcombobox.cpp.
◆ mouseDoubleClickEvent()
|
protected |
Definition at line 326 of file kexidbcombobox.cpp.
◆ mousePressEvent()
|
protectedvirtual |
Definition at line 315 of file kexidbcombobox.cpp.
◆ moveCursorToEndInInternalEditor()
|
protectedvirtual |
Implemented for KexiComboBoxBase. Does nothing if the widget is not editable.
Implements KexiComboBoxBase.
Definition at line 429 of file kexidbcombobox.cpp.
◆ origValue()
|
inlinevirtual |
Implemented for KexiComboBoxBase.
Implements KexiComboBoxBase.
Definition at line 57 of file kexidbcombobox.h.
◆ paintEvent()
|
protectedvirtual |
- Todo:
- support reverse layout
Definition at line 124 of file kexidbcombobox.cpp.
◆ paletteBackgroundColor()
|
inline |
Definition at line 85 of file kexidbcombobox.h.
◆ popup()
|
protectedvirtual |
Implements KexiComboBoxBase.
Definition at line 94 of file kexidbcombobox.cpp.
◆ popupWidthHint()
|
protectedvirtual |
Implement this to return a hint for popup width.
Implements KexiComboBoxBase.
Definition at line 485 of file kexidbcombobox.cpp.
◆ selectAllInInternalEditor()
|
protectedvirtual |
Implemented for KexiComboBoxBase. Does nothing if the widget is not editable.
Implements KexiComboBoxBase.
Definition at line 435 of file kexidbcombobox.cpp.
◆ setColumnInfo()
|
virtual |
Reimplemented after KexiDBAutoField: jsut sets cinfo without initializing a subwidget.
Initialization is performed by setVisibleColumnInfo().
Reimplemented from KexiDBAutoField.
Definition at line 412 of file kexidbcombobox.cpp.
◆ setEditable()
| void KexiDBComboBox::setEditable | ( | bool | set | ) |
Definition at line 104 of file kexidbcombobox.cpp.
◆ setLabelPosition()
|
virtual |
Reimplemented from KexiDBAutoField.
Definition at line 210 of file kexidbcombobox.cpp.
◆ setPaletteBackgroundColor()
|
virtual |
Reimplemented to also set 'this' widget's background color, not only subwidget's.
Reimplemented from KexiDBAutoField.
Definition at line 393 of file kexidbcombobox.cpp.
◆ setPopup()
|
protectedvirtual |
Implements KexiComboBoxBase.
Definition at line 99 of file kexidbcombobox.cpp.
◆ setValueInInternalEditor()
|
protectedvirtual |
Implemented for KexiComboBoxBase.
removeOld
Implements KexiComboBoxBase.
Definition at line 462 of file kexidbcombobox.cpp.
◆ setValueInternal()
|
protectedvirtual |
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 441 of file kexidbcombobox.cpp.
◆ setVisibleColumnInfo()
|
virtual |
Used internally to set visible database column information. Reimplemented: performs initialization of the subwidget.
Reimplemented from KexiFormDataItemInterface.
Definition at line 417 of file kexidbcombobox.cpp.
◆ setVisibleValueInternal()
|
protectedvirtual |
Implemented to handle visible value instead of index.
removeOld
Reimplemented from KexiDataItemInterface.
Definition at line 450 of file kexidbcombobox.cpp.
◆ sizeHint()
|
virtual |
Reimplemented from KexiDBAutoField.
Definition at line 504 of file kexidbcombobox.cpp.
◆ slotInternalEditorValueChanged
|
inlineprotectedslot |
Definition at line 100 of file kexidbcombobox.h.
◆ slotItemSelected
|
inlineslot |
Definition at line 97 of file kexidbcombobox.h.
◆ slotRowAccepted
|
slot |
Definition at line 526 of file kexidbcombobox.cpp.
◆ styleChange()
|
protectedvirtual |
Reimplemented
Definition at line 496 of file kexidbcombobox.cpp.
◆ subwidgetStretchRequired()
|
protectedvirtual |
Definition at line 387 of file kexidbcombobox.cpp.
◆ undoChanges()
|
virtual |
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 KexiFormDataItemInterface.
Definition at line 543 of file kexidbcombobox.cpp.
◆ value()
|
inlinevirtual |
- Returns
- value currently represented by this item.
Reimplemented from KexiDBAutoField.
Definition at line 64 of file kexidbcombobox.h.
◆ valueChanged()
|
virtual |
Reimpemented because to avoid taking value from the internal editor (index is taken from the popup instead)
Reimplemented from KexiDBAutoField.
Definition at line 405 of file kexidbcombobox.cpp.
◆ valueFromInternalEditor()
|
protectedvirtual |
Implemented for KexiComboBoxBase.
Implements KexiComboBoxBase.
Definition at line 471 of file kexidbcombobox.cpp.
◆ visibleColumnInfo()
|
virtual |
- Returns
- visible database column information for this item. Reimplemented.
Reimplemented from KexiFormDataItemInterface.
Definition at line 424 of file kexidbcombobox.cpp.
◆ visibleValue()
|
virtual |
- Returns
- value that should be displayed for this item. Only used for items like combo box, where real value is an integer while displayed value is usually a text. For other item types this method should be empty.
Reimplemented from KexiDataItemInterface.
Definition at line 457 of file kexidbcombobox.cpp.
Member Data Documentation
◆ d
|
protected |
Definition at line 179 of file kexidbcombobox.h.
The documentation for this class was generated from the following files:

Public Slots inherited from