kexi

KexiFormDataProvider Class Reference

#include <kexidataprovider.h>

Inheritance diagram for KexiFormDataProvider:

KexiDataItemChangesListener KexiFormScrollView

List of all members.


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, the 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 43 of file kexidataprovider.h.


Public Member Functions

void setMainDataSourceWidget (QWidget *mainWidget)
QStringList usedDataSources () const
void fillDataItems (KexiTableItem &row, bool cursorAtNewRow)
virtual void valueChanged (KexiDataItemInterface *item)
virtual bool cursorAtNewRow () const
void invalidateDataSources (const QDict< char > &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: 1

Member Function Documentation

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 49 of file kexidataprovider.cpp.

void KexiFormDataProvider::fillDataItems ( KexiTableItem &  row,
bool  cursorAtNewRow 
)

Fills data items with appropriate data fetched from cursor. newRowEditing == true means that we are at new (not yet inserted) database row.

remove old

Definition at line 94 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 176 of file kexidataprovider.cpp.

bool KexiFormDataProvider::cursorAtNewRow (  )  const [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 181 of file kexidataprovider.cpp.

void KexiFormDataProvider::invalidateDataSources ( const QDict< char > &  invalidSources,
KexiDB::QuerySchema query = 0 
)

Invalidates data sources collected by this provided. invalidSources is the set of data sources that should be omitted for fillDataItems(). Used by KexiFormView::initDataSource().

query

Definition at line 186 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 134 of file kexidataprovider.cpp.


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