KexiDBAutoField Class Reference
#include <kexidbautofield.h>
Inheritance diagram for KexiDBAutoField:

Detailed Description
Universal "Auto Field" widget for Kexi forms.It acts as a container for most data-aware widgets.
Definition at line 36 of file kexidbautofield.h.
Public Types | |
| enum | WidgetType { Auto = 100, Text, Integer, Double, Boolean, Date, Time, DateTime, MultiLineText, ComboBox, Image } |
| enum | LabelPosition { Left = 300, Top, NoLabel } |
Public Slots | |
| virtual void | unsetPalette () |
Public Member Functions | |
| KexiDBAutoField (const QString &text, WidgetType type, LabelPosition pos, QWidget *parent=0, const char *name=0, bool designMode=true) | |
| KexiDBAutoField (QWidget *parent=0, const char *name=0, bool designMode=true, LabelPosition pos=Left) | |
| virtual | ~KexiDBAutoField () |
| QString | dataSource () const |
| QCString | dataSourceMimeType () const |
| virtual void | setDataSource (const QString &ds) |
| Sets the name of the data source for this widget. | |
| virtual void | setDataSourceMimeType (const QCString &ds) |
| virtual void | setColumnInfo (KexiDB::QueryColumnInfo *cinfo) |
| virtual void | setInvalidState (const QString &text) |
| virtual bool | isReadOnly () const |
| virtual void | setReadOnly (bool readOnly) |
| virtual QVariant | value () |
| virtual bool | valueIsNull () |
| virtual bool | valueIsEmpty () |
| virtual bool | valueIsValid () |
| virtual bool | valueChanged () |
| virtual void | clear () |
| clears item's data, so the data will contain NULL data | |
| virtual void | installListener (KexiDataItemChangesListener *listener) |
| Reimpelmented to also install listenter for internal editor. | |
| WidgetType | widgetType () const |
| void | setWidgetType (WidgetType type) |
| LabelPosition | labelPosition () const |
| virtual void | setLabelPosition (LabelPosition position) |
| QString | caption () const |
| void | setCaption (const QString &caption) |
| bool | hasAutoCaption () const |
| void | setAutoCaption (bool autoCaption) |
| virtual void | setDisplayDefaultValue (QWidget *widget, bool displayDefaultValue) |
| QWidget * | editor () const |
| QLabel * | label () const |
| virtual bool | cursorAtStart () |
| virtual bool | cursorAtEnd () |
| void | setFieldTypeInternal (int kexiDBFieldType) |
| void | setFieldCaptionInternal (const QString &text) |
| int | fieldTypeInternal () const |
| QString | fieldCaptionInternal () const |
| virtual QSize | sizeHint () const |
| virtual void | setFocusPolicy (FocusPolicy policy) |
| const QColor & | paletteForegroundColor () const |
| Reimplemented to return internal editor's color. | |
| void | setPaletteForegroundColor (const QColor &color) |
| Reimplemented to set internal editor's color. | |
| const QColor & | paletteBackgroundColor () const |
| Reimplemented to return internal editor's color. | |
| virtual void | setPaletteBackgroundColor (const QColor &color) |
| Reimplemented to set internal editor's color. | |
| const QColor & | foregroundLabelColor () const |
| virtual void | setForegroundLabelColor (const QColor &color) |
| Sets label's foreground color. | |
| const QColor & | backgroundLabelColor () const |
| virtual void | setBackgroundLabelColor (const QColor &color) |
| Sets label's background color. | |
| virtual QVariant | property (const char *name) const |
| Reimplemented to accept subproperties. | |
| virtual bool | setProperty (const char *name, const QVariant &value) |
| Reimplemented to accept subproperties. | |
| virtual bool | keyPressed (QKeyEvent *ke) |
Static Public Member Functions | |
| static WidgetType | widgetTypeForFieldType (KexiDB::Field::Type type) |
Protected Slots | |
| virtual void | paletteChange (const QPalette &oldPal) |
| virtual void | moveCursorToEnd () |
| Implemented for KexiDataItemInterface. | |
| virtual void | moveCursorToStart () |
| Implemented for KexiDataItemInterface. | |
| virtual void | selectAll () |
| Implemented for KexiDataItemInterface. | |
Protected Member Functions | |
| virtual void | setValueInternal (const QVariant &add, bool removeOld) |
| void | init (const QString &text, WidgetType type, LabelPosition pos) |
| virtual void | createEditor () |
| void | changeText (const QString &text, bool beautify=true) |
| void | updateInformationAboutUnboundField () |
| void | copyPropertiesToEditor () |
| internal editor can be created too late, so certain properties should be copied | |
| virtual bool | eventFilter (QObject *o, QEvent *e) |
| void | setLabelPositionInternal (LabelPosition position, bool noLabel) |
| Used by setLabelPositionInternal(LabelPosition). | |
| void | setColumnInfoInternal (KexiDB::QueryColumnInfo *cinfo, KexiDB::QueryColumnInfo *visibleColumnInfo) |
| Used by KexiDBAutoField::setColumnInfo() and KexiDBComboBox::setColumnInfo(). | |
Properties | |
| QColor | foregroundLabelColor |
| QColor | backgroundLabelColor |
| bool | autoCaption |
| QString | dataSource |
| QCString | dataSourceMimeType |
| bool | readOnly |
| LabelPosition | labelPosition |
| WidgetType | widgetType |
| int | fieldTypeInternal |
| QString | fieldCaptionInternal |
Member Enumeration Documentation
|
|
Definition at line 63 of file kexidbautofield.h. |
|
|
Definition at line 61 of file kexidbautofield.h. |
Constructor & Destructor Documentation
|
||||||||||||||||||||||||||||
|
Definition at line 74 of file kexidbautofield.cpp. References init(). |
|
||||||||||||||||||||
|
Definition at line 85 of file kexidbautofield.cpp. |
|
|
Definition at line 95 of file kexidbautofield.cpp. References KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget. |
Member Function Documentation
|
|
|
|
|
Definition at line 402 of file kexidbautofield.cpp. |
|
||||||||||||
|
Definition at line 567 of file kexidbautofield.cpp. References Auto, Boolean, dataSource(), and KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget. Referenced by createEditor(), setAutoCaption(), setCaption(), setColumnInfoInternal(), and setFieldCaptionInternal(). |
|
|
clears item's data, so the data will contain NULL data
Implements KexiDataItemInterface. Definition at line 451 of file kexidbautofield.cpp. References KexiDataItemInterface::clear(), and KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget. |
|
|
internal editor can be created too late, so certain properties should be copied
Definition at line 205 of file kexidbautofield.cpp. References Boolean, and KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget. Referenced by createEditor(), setPaletteBackgroundColor(), and setPaletteForegroundColor(). |
|
|
Reimplemented in KexiDBComboBox. Definition at line 142 of file kexidbautofield.cpp. References Boolean, changeText(), KFormDesigner::DesignTimeDynamicChildWidgetHandler::childWidgetAdded(), KexiFormDataItemInterface::columnInfo(), ComboBox, copyPropertiesToEditor(), dataSource(), Date, DateTime, Double, Image, Integer, labelPosition(), KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget, MultiLineText, setLabelPosition(), KFormDesigner::WidgetWithSubpropertiesInterface::setSubwidget(), Text, Time, and KexiFormDataItemInterface::visibleColumnInfo(). Referenced by KexiDBComboBox::createEditor(), setColumnInfoInternal(), setFieldTypeInternal(), setInvalidState(), and setWidgetType(). |
|
|
Implements KexiDataItemInterface. Definition at line 442 of file kexidbautofield.cpp. References KexiDataItemInterface::cursorAtEnd(), and KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget. |
|
|
Implements KexiDataItemInterface. Definition at line 433 of file kexidbautofield.cpp. References KexiDataItemInterface::cursorAtStart(), and KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget. |
|
|
Reimplemented from KexiFormDataItemInterface. Definition at line 72 of file kexidbautofield.h. References KexiFormDataItemInterface::dataSource(). Referenced by changeText(), createEditor(), setColumnInfoInternal(), and updateInformationAboutUnboundField(). |
|
|
Reimplemented from KexiFormDataItemInterface. Definition at line 73 of file kexidbautofield.h. References KexiFormDataItemInterface::dataSourceMimeType(). Referenced by updateInformationAboutUnboundField(). |
|
|
Definition at line 412 of file kexidbautofield.cpp. References KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget. |
|
||||||||||||
|
Reimplemented in KexiDBComboBox. Definition at line 801 of file kexidbautofield.cpp. Referenced by KexiDBComboBox::eventFilter(). |
|
|
|
|
|
Referenced by setLabelPosition(). |
|
|
|
|
|
Definition at line 407 of file kexidbautofield.cpp. |
|
||||||||||||||||
|
Definition at line 104 of file kexidbautofield.cpp. References Auto, KexiDB::Field::InvalidType, KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget, setLabelPosition(), setWidgetType(), and Text. Referenced by KexiDBAutoField(). |
|
|
Reimpelmented to also install listenter for internal editor.
Reimplemented from KexiDataItemInterface. Definition at line 384 of file kexidbautofield.cpp. References KexiDataItemInterface::installListener(), and KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget. |
|
|
Reimplemented from KexiDataItemInterface. Definition at line 311 of file kexidbautofield.cpp. References KexiDataItemInterface::isReadOnly(), and KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget. |
|
|
Called by the top-level form on key press event to consume widget-specific shortcuts. Reimplemented from KexiFormDataItemInterface. Reimplemented in KexiDBComboBox. Definition at line 838 of file kexidbautofield.cpp. References KexiFormDataItemInterface::keyPressed(), and KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget. Referenced by KexiDBComboBox::keyPressed(). |
|
|
Definition at line 417 of file kexidbautofield.cpp. |
|
|
Referenced by createEditor(). |
|
|
Implemented for KexiDataItemInterface.
Reimplemented from KexiDataItemInterface. Definition at line 817 of file kexidbautofield.cpp. References KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget, and KexiDataItemInterface::moveCursorToEnd(). Referenced by KexiDBComboBox::moveCursorToEndInInternalEditor(). |
|
|
Implemented for KexiDataItemInterface.
Reimplemented from KexiDataItemInterface. Definition at line 824 of file kexidbautofield.cpp. References KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget, and KexiDataItemInterface::moveCursorToStart(). |
|
|
Reimplemented to return internal editor's color.
Reimplemented in KexiDBComboBox. Definition at line 734 of file kexidbautofield.cpp. Referenced by KexiDBComboBox::paletteBackgroundColor(). |
|
|
Definition at line 709 of file kexidbautofield.cpp. |
|
|
Reimplemented to return internal editor's color.
Definition at line 723 of file kexidbautofield.cpp. |
|
|
Reimplemented to accept subproperties.
Definition at line 784 of file kexidbautofield.cpp. References KFormDesigner::WidgetWithSubpropertiesInterface::subproperty(). |
|
|
Implemented for KexiDataItemInterface.
Reimplemented from KexiDataItemInterface. Definition at line 831 of file kexidbautofield.cpp. References KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget, and KexiDataItemInterface::selectAll(). Referenced by KexiDBComboBox::selectAllInInternalEditor(). |
|
|
Definition at line 628 of file kexidbautofield.cpp. References changeText(), and KexiFormDataItemInterface::columnInfo(). |
|
|
Sets label's background color.
Definition at line 771 of file kexidbautofield.cpp. References Boolean, and setPaletteBackgroundColor(). |
|
|
Definition at line 620 of file kexidbautofield.cpp. References changeText(). |
|
|
Used internally to set database column information. Reimplement if you need to do additional actions, e.g. set data validator based on field type. Don't forget about calling superclass implementation. Reimplemented from KexiFormDataItemInterface. Reimplemented in KexiDBComboBox. Definition at line 494 of file kexidbautofield.cpp. References KexiFormDataItemInterface::setColumnInfo(), and setColumnInfoInternal(). Referenced by setDataSource(), and KexiFormView::updateAutoFieldsDataSource(). |
|
||||||||||||
|
|
Sets the name of the data source for this widget. Data source usually means here a table or query or field name name. Reimplemented from KexiFormDataItemInterface. Definition at line 645 of file kexidbautofield.cpp. References setColumnInfo(), and KexiFormDataItemInterface::setDataSource(). |
|
|
Sets the mime type of the data source for this widget. Data source usually means here a "kexi/table" or "kexi/query".
Reimplemented from KexiFormDataItemInterface. Definition at line 75 of file kexidbautofield.h. References KexiFormDataItemInterface::setDataSourceMimeType(). |
|
||||||||||||
|
If displayDefaultValue is true, the value set by KexiDataItemInterface::setValue() is displayed in a special way. Used by KexiFormDataProvider::fillDataItems(). widget is equal to 'this'. Reimplemented after KexiFormDataItemInterface. Reimplemented from KexiFormDataItemInterface. Definition at line 810 of file kexidbautofield.cpp. References KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget, and KexiFormDataItemInterface::setDisplayDefaultValue(). |
|
|
On design time it is not possible to pass a reference to KexiDB::Field object so we're just providing field caption. Only used when widget type is Auto. Definition at line 483 of file kexidbautofield.cpp. References changeText(), KexiFormDataItemInterface::columnInfo(), and KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget. Referenced by setFieldTypeInternal(). |
|
|
On design time it is not possible to pass a reference to KexiDB::Field object so we're just providing field type. Only used when widget type is Auto. Definition at line 459 of file kexidbautofield.cpp. References createEditor(), KexiDB::Field::InvalidType, setFieldCaptionInternal(), KexiDB::Field::Text, KexiFormDataItemInterface::visibleColumnInfo(), and widgetTypeForFieldType(). |
|
|
Definition at line 670 of file kexidbautofield.cpp. References KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget. Referenced by KexiDBComboBox::KexiDBComboBox(), and setInvalidState(). |
|
|
Sets label's foreground color.
Definition at line 753 of file kexidbautofield.cpp. References Boolean, and setPaletteForegroundColor(). |
|
|
Implements KexiFormDataItemInterface. Definition at line 296 of file kexidbautofield.cpp. References Auto, createEditor(), KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget, and setFocusPolicy(). |
|
|
Reimplemented in KexiDBComboBox. Definition at line 222 of file kexidbautofield.cpp. References KexiSubwidgetInterface::appendStretchRequired(), Auto, Boolean, fieldTypeInternal(), KexiDB::Field::InvalidType, KexiDBAutoField_SPACING, Left, KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget, size, KexiSubwidgetInterface::subwidgetStretchRequired(), and Top. Referenced by createEditor(), and init(). |
|
||||||||||||
|
Used by setLabelPositionInternal(LabelPosition).
|
|
|
Reimplemented to set internal editor's color.
Reimplemented in KexiDBComboBox. Definition at line 739 of file kexidbautofield.cpp. References copyPropertiesToEditor(). Referenced by setBackgroundLabelColor(), and KexiDBComboBox::setPaletteBackgroundColor(). |
|
|
Reimplemented to set internal editor's color.
Definition at line 728 of file kexidbautofield.cpp. References copyPropertiesToEditor(). Referenced by setForegroundLabelColor(). |
|
||||||||||||
|
Reimplemented to accept subproperties.
Definition at line 793 of file kexidbautofield.cpp. References KFormDesigner::WidgetWithSubpropertiesInterface::setSubproperty(). |
|
|
Changes 'read only' flag, for this widget. Typically this flag can be passed to a widget itself, e.g. KLineEdit::setReadOnly(bool). Implements KexiFormDataItemInterface. Definition at line 321 of file kexidbautofield.cpp. References KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget, and KexiFormDataItemInterface::setReadOnly(). |
|
||||||||||||
|
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. Implements KexiDataItemInterface. Reimplemented in KexiDBComboBox. Definition at line 329 of file kexidbautofield.cpp. References KexiDataItemInterface::m_origValue, KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget, and KexiDataItemInterface::setValue(). |
|
|
Definition at line 124 of file kexidbautofield.cpp. References Auto, createEditor(), KexiFormDataItemInterface::field(), KexiDB::Field::type(), KexiFormDataItemInterface::visibleColumnInfo(), and widgetTypeForFieldType(). Referenced by init(). |
|
|
Reimplemented in KexiDBComboBox. Definition at line 653 of file kexidbautofield.cpp. References KexiDBAutoField_SPACING, KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget, NoLabel, and Top. |
|
|
Definition at line 715 of file kexidbautofield.cpp. |
|
|
Definition at line 680 of file kexidbautofield.cpp. References dataSource(), and dataSourceMimeType(). |
|
|
Implements KexiDataItemInterface. Reimplemented in KexiDBComboBox. Definition at line 338 of file kexidbautofield.cpp. References KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget, and KexiDataItemInterface::value(). Referenced by KexiDBComboBox::valueFromInternalEditor(). |
|
|
Reimplemented from KexiDataItemInterface. Reimplemented in KexiDBComboBox. Definition at line 374 of file kexidbautofield.cpp. References kexipluginsdbg, KexiDataItemInterface::m_origValue, KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget, and KexiDataItemInterface::valueChanged(). |
|
|
Implements KexiDataItemInterface. Definition at line 356 of file kexidbautofield.cpp. References KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget, and KexiDataItemInterface::valueIsEmpty(). |
|
|
Implements KexiDataItemInterface. Definition at line 347 of file kexidbautofield.cpp. References KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget, and KexiDataItemInterface::valueIsNull(). |
|
|
Reimplemented from KexiDataItemInterface. Definition at line 365 of file kexidbautofield.cpp. References KFormDesigner::WidgetWithSubpropertiesInterface::m_subwidget, and KexiDataItemInterface::valueIsValid(). |
|
|
|
|
|
Definition at line 532 of file kexidbautofield.cpp. References Auto, KexiDB::Field::BigInteger, KexiDB::Field::BLOB, Boolean, KexiDB::Field::Boolean, ComboBox, Date, KexiDB::Field::Date, DateTime, KexiDB::Field::DateTime, Double, KexiDB::Field::Double, KexiDB::Field::Enum, KexiDB::Field::Float, Image, Integer, KexiDB::Field::Integer, KexiDB::Field::InvalidType, KexiDB::Field::LongText, MultiLineText, KexiDB::Field::ShortInteger, Text, KexiDB::Field::Text, Time, and KexiDB::Field::Time. Referenced by setColumnInfoInternal(), setFieldTypeInternal(), and setWidgetType(). |
Property Documentation
|
|
Definition at line 49 of file kexidbautofield.h. |
|
|
Definition at line 48 of file kexidbautofield.h. |
|
|
Definition at line 50 of file kexidbautofield.h. Referenced by KexiFormView::updateAutoFieldsDataSource(). |
|
|
Definition at line 51 of file kexidbautofield.h. |
|
|
Definition at line 57 of file kexidbautofield.h. |
