kexi

KexiComboBoxBase Class Reference

#include <kexicomboboxbase.h>

Inheritance diagram for KexiComboBoxBase:

KexiComboBoxTableEdit KexiDBComboBox List of all members.

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 KexiTableViewColumncolumn () const=0
virtual KexiDB::Fieldfield () const=0
virtual QVariant origValue () const=0
virtual QVariant value ()
virtual QVariant visibleValue ()
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 QVariant &v)
virtual QWidget * internalEditor () const=0

Protected Member Functions

virtual void setValueInternal (const QVariant &add, bool removeOld)
KexiTableItemselectItemForEnteredValueInLookupTable (const QVariant &v)
QString valueForString (const QString &str, int *row, uint lookInColumn, uint returnFromColumn, bool allowNulls=false)
void setValueOrTextInInternalEditor (const QVariant &value)
KexiDB::LookupFieldSchemalookupFieldSchema () const
int rowToHighlightForLookupTable () const
virtual void moveCursorToEndInInternalEditor ()=0
virtual void selectAllInInternalEditor ()=0
virtual void setValueInInternalEditor (const QVariant &value)=0
virtual QVariant valueFromInternalEditor ()=0
virtual void editRequested ()=0
virtual void acceptRequested ()=0
virtual QPoint mapFromParentToGlobal (const QPoint &pos) const=0
virtual int popupWidthHint () const=0
virtual void updateButton ()
virtual KexiComboBoxPopuppopup () const=0
virtual void setPopup (KexiComboBoxPopup *popup)=0
virtual QVariant visibleValueForLookupField ()
void updateTextForHighlightedRow ()
bool handleKeyPressForPopup (QKeyEvent *ke)
void acceptPopupSelection ()
void undoChanges ()

Protected Attributes

QVariant m_visibleValue
QVariant m_userEnteredValue
bool m_internalEditorValueChanged: 1
bool m_slotInternalEditorValueChanged_enabled: 1
bool m_setValueOrTextInInternalEditor_enabled: 1
bool m_mouseBtnPressedWhenPopupVisible: 1
bool m_insideCreatePopup: 1
bool m_updatePopupSelectionOnShow: 1
bool m_moveCursorToEndInInternalEditor_enabled: 1
bool m_selectAllInInternalEditor_enabled: 1
bool m_setValueInInternalEditor_enabled: 1
bool m_setVisibleValueOnSetValueInternal: 1

Member Function Documentation

virtual KexiTableViewColumn* KexiComboBoxBase::column (  )  const [pure virtual]

Returns:
column related to this combo; for KexiComboBoxTableEdit 0 is returned here

Implemented in KexiDBComboBox, and KexiComboBoxTableEdit.

virtual KexiDB::Field* KexiComboBoxBase::field (  )  const [pure virtual]

Returns:
database field related to this combo

Implemented in KexiDBComboBox, and KexiComboBoxTableEdit.

virtual QVariant KexiComboBoxBase::origValue (  )  const [pure virtual]

Returns:
the original value

Implemented in KexiDBComboBox, and KexiComboBoxTableEdit.

QVariant KexiComboBoxBase::value (  )  [virtual]

Note: Generally in current implementation this is integer > 0; may be null if no value is set.

it &&

Todo:
don't return just 1st row, but use autocompletion feature and: show message box if entered text does not match!

Reimplemented in KexiDBComboBox, and KexiComboBoxTableEdit.

Definition at line 230 of file kexicomboboxbase.cpp.

void KexiComboBoxBase::clear (  )  [virtual]

Reimplement this and call this impl.: used to clear internal editor.

Reimplemented in KexiComboBoxTableEdit.

Definition at line 288 of file kexicomboboxbase.cpp.

void KexiComboBoxBase::createPopup ( bool  show  ) 

Definition at line 337 of file kexicomboboxbase.cpp.

void KexiComboBoxBase::slotRowAccepted ( KexiTableItem item,
int  row 
) [virtual]

Call this from slot.

Reimplemented in KexiDBComboBox, and KexiComboBoxTableEdit.

Definition at line 421 of file kexicomboboxbase.cpp.

void KexiComboBoxBase::slotItemSelected ( KexiTableItem  )  [virtual]

Call this from slot.

Reimplemented in KexiDBComboBox, and KexiComboBoxTableEdit.

Definition at line 443 of file kexicomboboxbase.cpp.

void KexiComboBoxBase::slotInternalEditorValueChanged ( const QVariant &  v  ) 

Call this from slot.

Reimplemented in KexiDBComboBox, and KexiComboBoxTableEdit.

Definition at line 484 of file kexicomboboxbase.cpp.

virtual QWidget* KexiComboBoxBase::internalEditor (  )  const [pure virtual]

Implement this to return the internal editor.

Implemented in KexiDBComboBox, and KexiComboBoxTableEdit.

void KexiComboBoxBase::setValueInternal ( const QVariant &  add,
bool  removeOld 
) [protected, virtual]

Reimplemented in KexiDBComboBox, and KexiComboBoxTableEdit.

Definition at line 86 of file kexicomboboxbase.cpp.

KexiTableItem * KexiComboBoxBase::selectItemForEnteredValueInLookupTable ( const QVariant &  v  )  [protected]

Used to select row item for an user-entered value v.

Only for "lookup table" mode.

Definition at line 163 of file kexicomboboxbase.cpp.

QString KexiComboBoxBase::valueForString ( const QString &  str,
int *  row,
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 200 of file kexicomboboxbase.cpp.

void KexiComboBoxBase::setValueOrTextInInternalEditor ( const QVariant &  value  )  [protected]

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 498 of file kexicomboboxbase.cpp.

int KexiComboBoxBase::rowToHighlightForLookupTable (  )  const [protected]

Definition at line 60 of file kexicomboboxbase.cpp.

virtual void KexiComboBoxBase::moveCursorToEndInInternalEditor (  )  [protected, pure virtual]

Implement this to perform "move cursor to end" in the internal editor.

Implemented in KexiDBComboBox, and KexiComboBoxTableEdit.

virtual void KexiComboBoxBase::selectAllInInternalEditor (  )  [protected, pure virtual]

Implement this to perform "select all" in the internal editor.

Implemented in KexiDBComboBox, and KexiComboBoxTableEdit.

virtual void KexiComboBoxBase::setValueInInternalEditor ( const QVariant &  value  )  [protected, pure virtual]

Implement this to perform "set value" in the internal editor.

Implemented in KexiDBComboBox, and KexiComboBoxTableEdit.

virtual QVariant KexiComboBoxBase::valueFromInternalEditor (  )  [protected, pure virtual]

Implement this to return value from the internal editor.

Implemented in KexiDBComboBox, and KexiComboBoxTableEdit.

virtual void KexiComboBoxBase::editRequested (  )  [protected, pure virtual]

Implement this as signal.

Implemented in KexiDBComboBox, and KexiComboBoxTableEdit.

virtual void KexiComboBoxBase::acceptRequested (  )  [protected, pure virtual]

Implement this as signal.

Implemented in KexiDBComboBox, and KexiComboBoxTableEdit.

virtual QPoint KexiComboBoxBase::mapFromParentToGlobal ( const QPoint &  pos  )  const [protected, pure virtual]

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.

virtual int KexiComboBoxBase::popupWidthHint (  )  const [protected, pure virtual]

Implement this to return a hint for popup width.

Implemented in KexiDBComboBox, and KexiComboBoxTableEdit.

virtual void KexiComboBoxBase::updateButton (  )  [inline, protected, virtual]

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.

void KexiComboBoxBase::undoChanges (  )  [protected]

Used by KexiDBComboBox.

Reimplemented in KexiDBComboBox.

Definition at line 572 of file kexicomboboxbase.cpp.


Member Data Documentation

value (usually a text) entered by hand (by the user)

Definition at line 151 of file kexicomboboxbase.h.

true if user has text or other value inside editor

Definition at line 153 of file kexicomboboxbase.h.

Used only by KexiComboBoxTableEdit.

Definition at line 156 of file kexicomboboxbase.h.

true if we're inside createPopup(); used in slotItemSelected()

Definition at line 157 of file kexicomboboxbase.h.

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.

Used in setValueInternal() to control whether we want to set visible value on setValueInternal()

  • true for table view's combo box.

Definition at line 164 of file kexicomboboxbase.h.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys