KexiComboBoxBase Class Reference
#include <kexicomboboxbase.h>
Inheritance diagram for KexiComboBoxBase:

Detailed Description
A base class for handling data-aware combo boxes. This class is used by KexiComboBoxTableEdit and KexiDBComboBox.
Definition at line 37 of file kexicomboboxbase.h.
Public Member Functions | |
| KexiComboBoxBase () | |
| virtual | ~KexiComboBoxBase () |
| virtual KexiTableViewColumn * | column () const =0 |
| virtual KexiDB::Field * | field () const =0 |
| virtual QVariant | origValue () const =0 |
| virtual QVariant | value () |
| Note: Generally in current implementation this is integer > 0; may be null if no value is set. | |
| virtual QVariant | visibleValue () |
| virtual void | clear () |
| Reimplement this and call this impl.: used to clear internal editor. | |
| 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) |
| Call this from slot. | |
| virtual void | slotItemSelected (KexiTableItem *) |
| Call this from slot. | |
| void | slotInternalEditorValueChanged (const QVariant &v) |
| Call this from slot. | |
| virtual QWidget * | internalEditor () const =0 |
| Implement this to return the internal editor. | |
Protected Member Functions | |
| virtual void | setValueInternal (const QVariant &add, bool removeOld) |
| KexiTableItem * | selectItemForEnteredValueInLookupTable (const QVariant &v) |
| Used to select row item for an user-entered value v. | |
| QString | valueForString (const QString &str, int *row, uint lookInColumn, uint returnFromColumn, bool allowNulls=false) |
| void | setValueOrTextInInternalEditor (const QVariant &value) |
| sets value for the line edit without setting a flag (m_userEnteredValue) that indicates that the text has been entered by hand (by a user) | |
| KexiDB::LookupFieldSchema * | lookupFieldSchema () const |
| int | rowToHighlightForLookupTable () const |
| virtual void | moveCursorToEndInInternalEditor ()=0 |
| Implement this to perform "move cursor to end" in the internal editor. | |
| virtual void | selectAllInInternalEditor ()=0 |
| Implement this to perform "select all" in the internal editor. | |
| virtual void | setValueInInternalEditor (const QVariant &value)=0 |
| Implement this to perform "set value" in the internal editor. | |
| virtual QVariant | valueFromInternalEditor ()=0 |
| Implement this to return value from the internal editor. | |
| virtual void | editRequested ()=0 |
| Implement this as signal. | |
| virtual void | acceptRequested ()=0 |
| Implement this as signal. | |
| virtual QPoint | mapFromParentToGlobal (const QPoint &pos) const =0 |
| Implement this to return a position pos mapped from parent (e.g. | |
| virtual int | popupWidthHint () const =0 |
| Implement this to return a hint for popup width. | |
| virtual void | updateButton () |
| Implement this to update button state. | |
| virtual KexiComboBoxPopup * | popup () const =0 |
| virtual void | setPopup (KexiComboBoxPopup *popup)=0 |
| virtual QVariant | visibleValueForLookupField () |
| void | updateTextForHighlightedRow () |
| bool | handleKeyPressForPopup (QKeyEvent *ke) |
| void | acceptPopupSelection () |
| void | undoChanges () |
| Used by KexiDBComboBox. | |
Protected Attributes | |
| QVariant | m_visibleValue |
| QVariant | m_userEnteredValue |
| value (usually a text) entered by hand (by the user) | |
| bool | m_internalEditorValueChanged: 1 |
| true if user has text or other value inside editor | |
| bool | m_slotInternalEditorValueChanged_enabled: 1 |
| Used in slotInternalEditorValueChanged(). | |
| bool | m_setValueOrTextInInternalEditor_enabled: 1 |
| Used in setValueOrTextInInternalEditor() and slotItemSelected(). | |
| bool | m_mouseBtnPressedWhenPopupVisible: 1 |
| Used only by KexiComboBoxTableEdit. | |
| bool | m_insideCreatePopup: 1 |
| true if we're inside createPopup(); used in slotItemSelected() | |
| bool | m_updatePopupSelectionOnShow: 1 |
| Set to false as soon as the item corresponding with the current value is selected in the popup table. | |
| bool | m_moveCursorToEndInInternalEditor_enabled: 1 |
| bool | m_selectAllInInternalEditor_enabled: 1 |
| bool | m_setValueInInternalEditor_enabled: 1 |
| bool | m_setVisibleValueOnSetValueInternal: 1 |
Used in setValueInternal() to control whether we want to set visible value on setValueInternal()
| |
Constructor & Destructor Documentation
|
|
|
Definition at line 49 of file kexicomboboxbase.cpp. |
Member Function Documentation
|
|
Definition at line 433 of file kexicomboboxbase.cpp. References popup(), and slotRowAccepted(). Referenced by KexiDBComboBox::handleKeyPressEvent(). |
|
|
Implement this as signal.
Implemented in KexiDBComboBox, and KexiComboBoxTableEdit. Referenced by slotRowAccepted(). |
|
|
Reimplement this and call this impl.: used to clear internal editor.
Reimplemented in KexiComboBoxTableEdit. Definition at line 290 of file kexicomboboxbase.cpp. References popup(), and slotInternalEditorValueChanged(). Referenced by KexiComboBoxTableEdit::clear(), and slotItemSelected(). |
|
|
Implemented in KexiDBComboBox, and KexiComboBoxTableEdit. Referenced by createPopup(), setValueInternal(), slotItemSelected(), value(), valueChangedInternal(), and valueForString(). |
|
|
todo alter the position to fit the popup within screen boundaries Definition at line 339 of file kexicomboboxbase.cpp. References column(), editRequested(), field(), internalEditor(), lookupFieldSchema(), m_insideCreatePopup, m_moveCursorToEndInInternalEditor_enabled, m_selectAllInInternalEditor_enabled, m_setValueInInternalEditor_enabled, m_updatePopupSelectionOnShow, mapFromParentToGlobal(), moveCursorToEndInInternalEditor(), origValue(), popup(), popupWidthHint(), rowToHighlightForLookupTable(), selectAllInInternalEditor(), setPopup(), setValueInInternalEditor(), slotItemSelected(), slotRowAccepted(), and valueForString(). Referenced by KexiComboBoxTableEdit::handleKeyPress(), setValueInternal(), showPopup(), and value(). |
|
|
Implement this as signal.
Implemented in KexiDBComboBox, and KexiComboBoxTableEdit. Referenced by createPopup(). |
|
|
Implemented in KexiDBComboBox, and KexiComboBoxTableEdit. Referenced by createPopup(), lookupFieldSchema(), setValueInternal(), and slotItemSelected(). |
|
|
Definition at line 510 of file kexicomboboxbase.cpp. References popup(), and updateTextForHighlightedRow(). Referenced by KexiComboBoxTableEdit::handleKeyPress(), and KexiDBComboBox::handleKeyPressEvent(). |
|
|
Reimplemented in KexiComboBoxTableEdit. Definition at line 417 of file kexicomboboxbase.cpp. References popup(). Referenced by KexiComboBoxTableEdit::hide(). |
|
|
Implement this to return the internal editor.
Implemented in KexiDBComboBox, and KexiComboBoxTableEdit. Referenced by createPopup(). |
|
|
Definition at line 53 of file kexicomboboxbase.cpp. References field(). Referenced by createPopup(), rowToHighlightForLookupTable(), selectItemForEnteredValueInLookupTable(), KexiComboBoxTableEdit::setupContents(), setValueInternal(), slotItemSelected(), undoChanges(), value(), valueChangedInternal(), visibleValueForLookupField(), and KexiComboBoxTableEdit::widthForValue(). |
|
|
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. Implemented in KexiDBComboBox, and KexiComboBoxTableEdit. Referenced by createPopup(). |
|
|
Implement this to perform "move cursor to end" in the internal editor.
Implemented in KexiDBComboBox, and KexiComboBoxTableEdit. Referenced by createPopup(), setValueInternal(), and slotItemSelected(). |
|
|
Implemented in KexiDBComboBox, and KexiComboBoxTableEdit. Referenced by createPopup(), rowToHighlightForLookupTable(), setValueInternal(), and value(). |
|
|
|
Implement this to return a hint for popup width.
Implemented in KexiDBComboBox, and KexiComboBoxTableEdit. Referenced by createPopup(). |
|
|
Definition at line 60 of file kexicomboboxbase.cpp. References KexiDB::LookupFieldSchema::boundColumn(), KexiTableViewData::iterator(), lookupFieldSchema(), origValue(), and popup(). Referenced by createPopup(), and setValueInternal(). |
|
|
Implement this to perform "select all" in the internal editor.
Implemented in KexiDBComboBox, and KexiComboBoxTableEdit. Referenced by createPopup(), setValueInternal(), and slotItemSelected(). |
|
|
Used to select row item for an user-entered value v. Only for "lookup table" mode. Definition at line 163 of file kexicomboboxbase.cpp. References KexiTableViewData::iterator(), lookupFieldSchema(), m_setValueOrTextInInternalEditor_enabled, popup(), and KexiDB::LookupFieldSchema::visibleColumn(). Referenced by KexiComboBoxTableEdit::handleKeyPress(), and value(). |
|
|
Implemented in KexiDBComboBox, and KexiComboBoxTableEdit. Referenced by createPopup(). |
|
|
Implement this to perform "set value" in the internal editor.
Implemented in KexiDBComboBox, and KexiComboBoxTableEdit. Referenced by createPopup(), setValueInternal(), and setValueOrTextInInternalEditor(). |
|
||||||||||||
|
Reimplemented in KexiDBComboBox, and KexiComboBoxTableEdit. Definition at line 86 of file kexicomboboxbase.cpp. References KexiDB::LookupFieldSchema::boundColumn(), column(), createPopup(), field(), lookupFieldSchema(), m_mouseBtnPressedWhenPopupVisible, m_setVisibleValueOnSetValueInternal, m_updatePopupSelectionOnShow, moveCursorToEndInInternalEditor(), origValue(), popup(), rowToHighlightForLookupTable(), selectAllInInternalEditor(), setValueInInternalEditor(), setValueOrTextInInternalEditor(), valueForString(), and KexiDB::LookupFieldSchema::visibleColumn(). Referenced by KexiDBComboBox::setValueInternal(), and KexiComboBoxTableEdit::setValueInternal(). |
|
|
sets value for the line edit without setting a flag (m_userEnteredValue) that indicates that the text has been entered by hand (by a user)
Definition at line 500 of file kexicomboboxbase.cpp. References m_internalEditorValueChanged, m_setValueOrTextInInternalEditor_enabled, m_userEnteredValue, and setValueInInternalEditor(). Referenced by setValueInternal(), slotItemSelected(), and undoChanges(). |
|
|
Definition at line 334 of file kexicomboboxbase.cpp. References createPopup(). Referenced by KexiDBComboBox::handleKeyPressEvent(), KexiDBComboBox::handleMousePressEvent(), and KexiComboBoxTableEdit::slotButtonClicked(). |
|
|
Call this from slot.
Reimplemented in KexiDBComboBox, and KexiComboBoxTableEdit. Definition at line 486 of file kexicomboboxbase.cpp. References m_internalEditorValueChanged, m_slotInternalEditorValueChanged_enabled, m_userEnteredValue, and popup(). Referenced by clear(), KexiDBComboBox::slotInternalEditorValueChanged(), and KexiComboBoxTableEdit::slotInternalEditorValueChanged(). |
|
|
Call this from slot.
Reimplemented in KexiDBComboBox, and KexiComboBoxTableEdit. Definition at line 445 of file kexicomboboxbase.cpp. References clear(), column(), field(), kexidbg, lookupFieldSchema(), m_insideCreatePopup, m_setValueOrTextInInternalEditor_enabled, m_updatePopupSelectionOnShow, m_visibleValue, moveCursorToEndInInternalEditor(), popup(), selectAllInInternalEditor(), setValueOrTextInInternalEditor(), and visibleValueForLookupField(). Referenced by createPopup(), KexiDBComboBox::slotItemSelected(), KexiComboBoxTableEdit::slotItemSelected(), slotRowAccepted(), and updateTextForHighlightedRow(). |
|
||||||||||||
|
Call this from slot.
Reimplemented in KexiDBComboBox, and KexiComboBoxTableEdit. Definition at line 423 of file kexicomboboxbase.cpp. References acceptRequested(), slotItemSelected(), and updateButton(). Referenced by acceptPopupSelection(), createPopup(), KexiDBComboBox::slotRowAccepted(), and KexiComboBoxTableEdit::slotRowAccepted(). |
|
|
Used by KexiDBComboBox.
Reimplemented in KexiDBComboBox. Definition at line 574 of file kexicomboboxbase.cpp. References lookupFieldSchema(), m_visibleValue, popup(), setValueOrTextInInternalEditor(), and visibleValueForLookupField(). Referenced by KexiDBComboBox::undoChanges(). |
|
|
Implement this to update button state. Table view just updates on/off state for the button depending on visibility of the popup Reimplemented in KexiComboBoxTableEdit. Definition at line 133 of file kexicomboboxbase.h. Referenced by slotRowAccepted(). |
|
|
Definition at line 567 of file kexicomboboxbase.cpp. References popup(), and slotItemSelected(). Referenced by handleKeyPressForPopup(). |
|
|
Note: Generally in current implementation this is integer > 0; may be null if no value is set. it &&
Reimplemented in KexiDBComboBox, and KexiComboBoxTableEdit. Definition at line 232 of file kexicomboboxbase.cpp. References KexiDB::LookupFieldSchema::boundColumn(), column(), createPopup(), lookupFieldSchema(), m_internalEditorValueChanged, m_userEnteredValue, origValue(), popup(), selectItemForEnteredValueInLookupTable(), valueForString(), and valueFromInternalEditor(). Referenced by KexiDBComboBox::value(), KexiComboBoxTableEdit::value(), and valueIsNull(). |
|
|
Definition at line 297 of file kexicomboboxbase.cpp. References cancelled, column(), lookupFieldSchema(), m_internalEditorValueChanged, and popup(). Referenced by KexiComboBoxTableEdit::valueChanged(). |
|
||||||||||||||||||||||||
|
Definition at line 202 of file kexicomboboxbase.cpp. References column(), KexiTableViewData::iterator(), and kexiwarn. Referenced by createPopup(), KexiComboBoxTableEdit::setupContents(), setValueInternal(), and value(). |
|
|
Implement this to return value from the internal editor.
Implemented in KexiDBComboBox, and KexiComboBoxTableEdit. Referenced by value(). |
|
|
Definition at line 329 of file kexicomboboxbase.cpp. References valueIsNull(). |
|
|
Definition at line 321 of file kexicomboboxbase.cpp. References value(). Referenced by valueIsEmpty(). |
|
|
Reimplemented in KexiDBComboBox, and KexiComboBoxTableEdit. Definition at line 285 of file kexicomboboxbase.cpp. References m_visibleValue. Referenced by KexiDBComboBox::visibleValue(), and KexiComboBoxTableEdit::visibleValue(). |
|
|
Definition at line 276 of file kexicomboboxbase.cpp. References lookupFieldSchema(), popup(), and KexiDB::LookupFieldSchema::visibleColumn(). Referenced by slotItemSelected(), and undoChanges(). |
Member Data Documentation
|
|
true if we're inside createPopup(); used in slotItemSelected()
Definition at line 157 of file kexicomboboxbase.h. Referenced by createPopup(), KexiComboBoxBase(), and slotItemSelected(). |
|
|
true if user has text or other value inside editor
Definition at line 153 of file kexicomboboxbase.h. Referenced by KexiComboBoxTableEdit::handleKeyPress(), KexiComboBoxBase(), setValueOrTextInInternalEditor(), slotInternalEditorValueChanged(), value(), and valueChangedInternal(). |
|
|
Used only by KexiComboBoxTableEdit.
Definition at line 156 of file kexicomboboxbase.h. Referenced by KexiComboBoxTableEdit::eventFilter(), KexiComboBoxBase(), setValueInternal(), and KexiComboBoxTableEdit::slotButtonClicked(). |
|
|
Definition at line 161 of file kexicomboboxbase.h. Referenced by createPopup(), KexiComboBoxBase(), and KexiDBComboBox::moveCursorToEndInInternalEditor(). |
|
|
Definition at line 162 of file kexicomboboxbase.h. Referenced by createPopup(), KexiComboBoxBase(), and KexiDBComboBox::selectAllInInternalEditor(). |
|
|
Definition at line 163 of file kexicomboboxbase.h. Referenced by createPopup(), KexiComboBoxBase(), and KexiDBComboBox::setValueInInternalEditor(). |
|
|
Used in setValueOrTextInInternalEditor() and slotItemSelected().
Definition at line 155 of file kexicomboboxbase.h. Referenced by KexiComboBoxBase(), selectItemForEnteredValueInLookupTable(), setValueOrTextInInternalEditor(), and slotItemSelected(). |
|
|
Used in setValueInternal() to control whether we want to set visible value on setValueInternal()
Definition at line 164 of file kexicomboboxbase.h. Referenced by KexiComboBoxBase(), KexiComboBoxTableEdit::KexiComboBoxTableEdit(), and setValueInternal(). |
|
|
Used in slotInternalEditorValueChanged().
Definition at line 154 of file kexicomboboxbase.h. Referenced by KexiComboBoxBase(), and slotInternalEditorValueChanged(). |
|
|
Set to false as soon as the item corresponding with the current value is selected in the popup table. This avoids selecting item for origValue() and thus loosing the recent choice. Definition at line 158 of file kexicomboboxbase.h. Referenced by createPopup(), KexiComboBoxBase(), setValueInternal(), and slotItemSelected(). |
|
|
value (usually a text) entered by hand (by the user)
Definition at line 151 of file kexicomboboxbase.h. Referenced by KexiComboBoxTableEdit::handleKeyPress(), setValueOrTextInInternalEditor(), slotInternalEditorValueChanged(), and value(). |
|
|
Definition at line 149 of file kexicomboboxbase.h. Referenced by slotItemSelected(), undoChanges(), and visibleValue(). |
The documentation for this class was generated from the following files:
