kexi

KexiDBComboBox Class Reference

#include <kexidbcombobox.h>

Inheritance diagram for KexiDBComboBox:

KexiDBAutoField KexiComboBoxBase KexiFormDataItemInterface KFormDesigner::DesignTimeDynamicChildWidgetHandler KFormDesigner::WidgetWithSubpropertiesInterface KexiDataItemInterface List of all members.

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)
void slotItemSelected (KexiTableItem *item)

Public Member Functions

 KexiDBComboBox (QWidget *parent, const char *name=0, bool designMode=true)
virtual ~KexiDBComboBox ()
virtual KexiTableViewColumncolumn () const
virtual KexiDB::Fieldfield () const
virtual QVariant origValue () const
void setEditable (bool set)
bool isEditable () const
virtual void setLabelPosition (LabelPosition position)
virtual QVariant value ()
virtual QVariant visibleValue ()
virtual bool valueChanged ()
virtual QSize sizeHint () const
virtual void setColumnInfo (KexiDB::QueryColumnInfo *cinfo)
virtual void setVisibleColumnInfo (KexiDB::QueryColumnInfo *cinfo)
virtual KexiDB::QueryColumnInfovisibleColumnInfo () const
const QColor & paletteBackgroundColor () const
virtual void setPaletteBackgroundColor (const QColor &color)
virtual void undoChanges ()

Protected Slots

void slotInternalEditorValueChanged (const QVariant &v)

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 ()
virtual void styleChange (QStyle &oldStyle)
virtual void fontChange (const QFont &oldFont)
virtual bool subwidgetStretchRequired (KexiDBAutoField *autoField) const
virtual QWidget * internalEditor () const
virtual void moveCursorToEndInInternalEditor ()
virtual void selectAllInInternalEditor ()
virtual void setValueInInternalEditor (const QVariant &value)
virtual QVariant valueFromInternalEditor ()
virtual void editRequested ()
virtual void acceptRequested ()
virtual QPoint mapFromParentToGlobal (const QPoint &pos) const
virtual int popupWidthHint () const
virtual void setValueInternal (const QVariant &add, bool removeOld)
virtual void setVisibleValueInternal (const QVariant &value)
bool handleMousePressEvent (QMouseEvent *e)
bool handleKeyPressEvent (QKeyEvent *ke)
virtual void beforeSignalValueChanged ()
virtual KexiComboBoxPopuppopup () const
virtual void setPopup (KexiComboBoxPopup *popup)
virtual bool keyPressed (QKeyEvent *ke)

Protected Attributes

Private *const d

Properties

bool editable []

Member Function Documentation

virtual KexiTableViewColumn* KexiDBComboBox::column (  )  const [inline, virtual]

Implemented for KexiComboBoxBase: form has no 'related data' model (only the full database model).

Implements KexiComboBoxBase.

Definition at line 50 of file kexidbcombobox.h.

virtual KexiDB::Field* KexiDBComboBox::field (  )  const [inline, virtual]

Implemented for KexiComboBoxBase.

Implements KexiComboBoxBase.

Definition at line 53 of file kexidbcombobox.h.

virtual QVariant KexiDBComboBox::origValue (  )  const [inline, virtual]

Implemented for KexiComboBoxBase.

Implements KexiComboBoxBase.

Definition at line 56 of file kexidbcombobox.h.

virtual QVariant KexiDBComboBox::value (  )  [inline, virtual]

Returns:
value currently represented by this item.

Reimplemented from KexiDBAutoField.

Definition at line 63 of file kexidbcombobox.h.

bool KexiDBComboBox::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 398 of file kexidbcombobox.cpp.

void KexiDBComboBox::setColumnInfo ( KexiDB::QueryColumnInfo cinfo  )  [virtual]

Reimplemented after KexiDBAutoField: jsut sets cinfo without initializing a subwidget.

Initialization is performed by setVisibleColumnInfo().

Reimplemented from KexiDBAutoField.

Definition at line 405 of file kexidbcombobox.cpp.

void KexiDBComboBox::setVisibleColumnInfo ( KexiDB::QueryColumnInfo cinfo  )  [virtual]

Used internally to set visible database column information. Reimplemented: performs initialization of the subwidget.

Reimplemented from KexiFormDataItemInterface.

Definition at line 410 of file kexidbcombobox.cpp.

KexiDB::QueryColumnInfo * KexiDBComboBox::visibleColumnInfo (  )  const [virtual]

Returns:
visible database column information for this item. Reimplemented.

Reimplemented from KexiFormDataItemInterface.

Definition at line 417 of file kexidbcombobox.cpp.

const QColor& KexiDBComboBox::paletteBackgroundColor (  )  const [inline]

Reimplemented to return internal editor's color.

Reimplemented from KexiDBAutoField.

Definition at line 84 of file kexidbcombobox.h.

void KexiDBComboBox::setPaletteBackgroundColor ( const QColor &  color  )  [virtual]

Reimplemented to also set 'this' widget's background color, not only subwidget's.

Reimplemented from KexiDBAutoField.

Definition at line 386 of file kexidbcombobox.cpp.

void KexiDBComboBox::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 KexiComboBoxBase.

Definition at line 534 of file kexidbcombobox.cpp.

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

Call this from slot.

Reimplemented from KexiComboBoxBase.

Definition at line 517 of file kexidbcombobox.cpp.

void KexiDBComboBox::slotItemSelected ( KexiTableItem item  )  [inline, virtual, slot]

Call this from slot.

Reimplemented from KexiComboBoxBase.

Definition at line 96 of file kexidbcombobox.h.

void KexiDBComboBox::slotInternalEditorValueChanged ( const QVariant &  v  )  [inline, protected, slot]

Call this from slot.

Reimplemented from KexiComboBoxBase.

Definition at line 99 of file kexidbcombobox.h.

void KexiDBComboBox::paintEvent ( QPaintEvent *   )  [protected, virtual]

Definition at line 124 of file kexidbcombobox.cpp.

QRect KexiDBComboBox::editorGeometry (  )  const [protected]

Returns:
internal editor's geometry

Definition at line 171 of file kexidbcombobox.cpp.

void KexiDBComboBox::createEditor (  )  [protected, virtual]

Creates editor.

Reimplemented, because if the combo box is not editable, editor should not be created.

Todo:
Qt4: set transparent background, for now we're setting button color

Reimplemented from KexiDBAutoField.

Definition at line 182 of file kexidbcombobox.cpp.

void KexiDBComboBox::styleChange ( QStyle &  oldStyle  )  [protected, virtual]

Reimplemented

Definition at line 487 of file kexidbcombobox.cpp.

void KexiDBComboBox::fontChange ( const QFont &  oldFont  )  [protected, virtual]

Reimplemented

Definition at line 481 of file kexidbcombobox.cpp.

virtual QWidget* KexiDBComboBox::internalEditor (  )  const [inline, protected, virtual]

Implemented for KexiComboBoxBase.

Implements KexiComboBoxBase.

Definition at line 129 of file kexidbcombobox.h.

void KexiDBComboBox::moveCursorToEndInInternalEditor (  )  [protected, virtual]

Implemented for KexiComboBoxBase. Does nothing if the widget is not editable.

Implements KexiComboBoxBase.

Definition at line 422 of file kexidbcombobox.cpp.

void KexiDBComboBox::selectAllInInternalEditor (  )  [protected, virtual]

Implemented for KexiComboBoxBase. Does nothing if the widget is not editable.

Implements KexiComboBoxBase.

Definition at line 428 of file kexidbcombobox.cpp.

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

Implemented for KexiComboBoxBase.

removeOld

Implements KexiComboBoxBase.

Definition at line 453 of file kexidbcombobox.cpp.

QVariant KexiDBComboBox::valueFromInternalEditor (  )  [protected, virtual]

Implemented for KexiComboBoxBase.

Implements KexiComboBoxBase.

Definition at line 462 of file kexidbcombobox.cpp.

void KexiDBComboBox::editRequested (  )  [protected, virtual]

Implemented for KexiComboBoxBase.

Implements KexiComboBoxBase.

Definition at line 508 of file kexidbcombobox.cpp.

void KexiDBComboBox::acceptRequested (  )  [protected, virtual]

Implemented for KexiComboBoxBase.

Implements KexiComboBoxBase.

Definition at line 512 of file kexidbcombobox.cpp.

QPoint KexiDBComboBox::mapFromParentToGlobal ( const QPoint &  pos  )  const [protected, 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.

Implements KexiComboBoxBase.

Definition at line 467 of file kexidbcombobox.cpp.

int KexiDBComboBox::popupWidthHint (  )  const [protected, virtual]

Implement this to return a hint for popup width.

Implements KexiComboBoxBase.

Definition at line 476 of file kexidbcombobox.cpp.

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

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 434 of file kexidbcombobox.cpp.

void KexiDBComboBox::setVisibleValueInternal ( const QVariant &  value  )  [protected, virtual]

Implemented to handle visible value instead of index.

removeOld

Reimplemented from KexiDataItemInterface.

Definition at line 441 of file kexidbcombobox.cpp.

void KexiDBComboBox::beforeSignalValueChanged (  )  [protected, virtual]

Implemented for KexiDataItemInterface.

Reimplemented from KexiDataItemInterface.

Definition at line 524 of file kexidbcombobox.cpp.

bool KexiDBComboBox::keyPressed ( QKeyEvent *  ke  )  [protected, virtual]

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 299 of file kexidbcombobox.cpp.


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