kexi
KexiFormDataProvider Class Reference
#include <kexidataprovider.h>
Inheritance diagram for KexiFormDataProvider:

Detailed Description
The KexiFormDataProvider class is a data provider for Kexi Forms.This provider collects data-aware widgets using setMainWidget(). Then, usedDataSources() unique list of required field names is available. On every call of fillDataItems() method, thew provider will fill data items with appropriate data from a database cursor.
Field names are collected effectively, so eg. having widgets using data sources: ("name", "surname", "surname", "name") - "name" and "surname" repeated - will only return ("name", "surname") list, so the cursor's query can be simplified and thus more effective.
Definition at line 42 of file kexidataprovider.h.
Public Member Functions | |
KexiFormDataProvider () | |
virtual | ~KexiFormDataProvider () |
void | setMainDataSourceWidget (QWidget *mainWidget) |
QStringList | usedDataSources () const |
void | fillDataItems (KexiTableItem &row) |
virtual void | valueChanged (KexiDataItemInterface *item) |
virtual bool | cursorAtNewRow () |
void | invalidateDataSources (const QValueList< uint > &invalidSources, KexiDB::QuerySchema *query=0) |
void | fillDuplicatedDataItems (KexiFormDataItemInterface *item, const QVariant &value) |
Protected Types | |
typedef QMap< KexiFormDataItemInterface *, uint > | KexiFormDataItemInterfaceToIntMap |
Protected Attributes | |
QWidget * | m_mainWidget |
QPtrDict< char > * | m_duplicatedItems |
QPtrList< KexiFormDataItemInterface > | m_dataItems |
QStringList | m_usedDataSources |
KexiFormDataItemInterfaceToIntMap | m_fieldNumbersForDataItems |
bool | m_disableFillDuplicatedDataItems |
Member Function Documentation
bool KexiFormDataProvider::cursorAtNewRow | ( | ) | [virtual] |
Implementation for KexiDataItemChangesListener. Implement this to return information whether we're currently at new row or now. This can be used e.g. by data-aware widgets to determine if "(autonumber)" label should be displayed. Returns false here.
Implements KexiDataItemChangesListener.
Reimplemented in KexiFormScrollView.
Definition at line 152 of file kexidataprovider.cpp.
void KexiFormDataProvider::fillDataItems | ( | KexiTableItem & | row | ) |
Fills data items with appropriate data fetched from cursor.
Definition at line 93 of file kexidataprovider.cpp.
void KexiFormDataProvider::fillDuplicatedDataItems | ( | KexiFormDataItemInterface * | item, | |
const QVariant & | value | |||
) |
Fills the same data provided by value to every data item (other than item) having the same data source as item. This method is called immediately when value is changed, so duplicated data items are quickly updated.
Definition at line 105 of file kexidataprovider.cpp.
void KexiFormDataProvider::invalidateDataSources | ( | const QValueList< uint > & | invalidSources, | |
KexiDB::QuerySchema * | query = 0 | |||
) |
Invalidates data sources collected by this provided. invalidSources is the list of data sources that should be ommited for fillDataItems(). Used by KexiFormView::initDataSource().
query
Definition at line 157 of file kexidataprovider.cpp.
void KexiFormDataProvider::setMainDataSourceWidget | ( | QWidget * | mainWidget | ) |
sets mainWidget to be a main widget for this data provider. Also find widgets whose will work as data items (all of them must implement KexiFormDataItemInterface), so these could be filled with data on demand.
- Todo:
- reenable when subform is moved to KexiDBForm
Definition at line 48 of file kexidataprovider.cpp.
void KexiFormDataProvider::valueChanged | ( | KexiDataItemInterface * | item | ) | [virtual] |
Implementation for KexiDataItemChangesListener. Reaction for change of item. Does nothing here.
Implements KexiDataItemChangesListener.
Reimplemented in KexiFormScrollView.
Definition at line 147 of file kexidataprovider.cpp.
The documentation for this class was generated from the following files: