Items used by BpsTableModel.
More...
#include <bpstableitem.h>
List of all members.
Public Types |
| enum | CacheIndex { CacheDisplayColumnStart = 1000000
} |
| | Reserved cache indexes. More...
|
| enum | Status {
StatusSaved = 0,
StatusEdited = 1,
StatusAdded = 2,
StatusDeleted = 3
} |
| | Current status of the item. More...
|
Public Member Functions |
| void | addFields (const QSqlRecord &aRecord) |
| | Add more fields to the record.
|
| QVariant | cache (const QString &aField) const |
| | Get the named cache value.
|
| QVariant | cache (int aIndex) const |
| | Get the indexed cache value.
|
| bool | hasField (const QString &aField) |
| | Check if the field is present.
|
| bool | hasOptions (const QString &aTable) |
| | Check if the options are present.
|
|
QVariant | key () const |
| | The record key (value of c_key field), only valid when status in not StatusAdded.
|
| BpsTableOptions | options (const QString &aMappingTable) const |
| | Get the named option key set.
|
| void | setCache (const QString &aField, const QVariant &aValue) |
| | Set the cache value of the named field.
|
| void | setCache (int aIndex, const QVariant &aValue) |
| | Set the indexed cache value.
|
| bool | setOptions (const QString &aMappingTable, const BpsTableOptions &aOptions) |
| | Set the options of the named set.
|
| bool | setValue (const QString &aField, const QVariant &aValue) |
| | Set the value of the named field.
|
| BpsTableModel * | slaveModel (const QString &aTable) |
| | Get the named slave table model.
|
| Status | status () const |
| QVariant | value (const QString &aField) const |
| | Get the named value.
|
Friends |
|
class | BpsTableModel |
|
class | BpsTableModelPrivate |
Detailed Description
Items used by BpsTableModel.
Member Enumeration Documentation
Reserved cache indexes.
- Enumerator:
| CacheDisplayColumnStart |
This plus field count subsequent values are for display caching.
|
Current status of the item.
- Enumerator:
| StatusSaved |
Item, options and slaves are saved and unchanged in the model.
|
| StatusEdited |
Item, options or slave table models have unsaved changes.
|
| StatusAdded |
A new, yet unsaved item.
|
| StatusDeleted |
Item marked to get deleted from database.
|
Member Function Documentation
| void BpsTableItem::addFields |
( |
const QSqlRecord & |
aRecord | ) |
|
Add more fields to the record.
- Parameters:
-
| [in] | aRecord | The record containing the additional fields. |
| QVariant BpsTableItem::cache |
( |
const QString & |
aField | ) |
const |
Get the named cache value.
The cached value is used to store cache values, for example a thumbnail pixmap of an image stored as byte array (JPG, PNG) in the record value. The cache value gets cleared when the value is modified by setValue().
- Parameters:
-
| [in] | aField | Name of the field (column name). |
- Returns:
- The current cache value, or QVariant() in case there is no such cached value.
| QVariant BpsTableItem::cache |
( |
int |
aIndex | ) |
const |
Get the indexed cache value.
The indexes 0+numberOfFields-1 refers to the custom cache value which may also be accessed by cache(const QString& aField).
The indexes CacheDisplayColumnStart+numberOfFields-1 is reserved for internal display column caching.
- Parameters:
-
| [in] | aIndex | Index of the cached value. |
- Returns:
- The current cache value, or QVariant() in case there is no such cached value.
| bool BpsTableItem::hasField |
( |
const QString & |
aField | ) |
|
Check if the field is present.
- Parameters:
-
| [in] | aField | The field (column) name. |
- Returns:
- True if field is in record, false otherwise.
| bool BpsTableItem::hasOptions |
( |
const QString & |
aTable | ) |
|
Check if the options are present.
- Parameters:
-
| [in] | aTable | Name of the options table. |
- Returns:
- True if options are present, false otherwise.
| BpsTableOptions BpsTableItem::options |
( |
const QString & |
aMappingTable | ) |
const |
Get the named option key set.
- Parameters:
-
| [in] | aMappingTable | The name of the mapping table with the options. |
- Returns:
- The option set, or an empty set in case of invalid table name.
| void BpsTableItem::setCache |
( |
const QString & |
aField, |
|
|
const QVariant & |
aValue |
|
) |
| |
Set the cache value of the named field.
- Parameters:
-
| [in] | aField | Name of the field (column name). |
| [in] | aValue | The new cache value to set. Set QVariant() to clear the cache. |
| void BpsTableItem::setCache |
( |
int |
aIndex, |
|
|
const QVariant & |
aValue |
|
) |
| |
Set the indexed cache value.
The indexes 0+numberOfFields-1 refers to the custom cache value which may also be accessed by setCache(const QString& aField).
The indexes CacheDisplayColumnStart+numberOfFields-1 is reserved for internal display column caching.
- Parameters:
-
| [in] | aIndex | Index of the cached value. |
| [in] | aValue | The cached value. Set QVariant() to clear the cache. |
| bool BpsTableItem::setOptions |
( |
const QString & |
aMappingTable, |
|
|
const BpsTableOptions & |
aOptions |
|
) |
| |
Set the options of the named set.
- Parameters:
-
| [in] | aMappingTable | The name of the mapping table with the options. |
| [in] | aOptions | The new options to set |
- Returns:
- True if the options was changed, false if invalid table or options were already same.
| bool BpsTableItem::setValue |
( |
const QString & |
aField, |
|
|
const QVariant & |
aValue |
|
) |
| |
Set the value of the named field.
- Parameters:
-
| [in] | aField | Name of the field (column name). |
| [in] | aValue | The new value to set |
- Returns:
- True if the value was changed, false if invalid field name or value was already same.
| BpsTableModel* BpsTableItem::slaveModel |
( |
const QString & |
aTable | ) |
|
Get the named slave table model.
- Parameters:
-
| [in] | aTable | Table name of the desired slave model. |
- Returns:
- Model pointer, or 0 if no such slave model.
| Status BpsTableItem::status |
( |
| ) |
const |
- Returns:
- The current status.
| QVariant BpsTableItem::value |
( |
const QString & |
aField | ) |
const |
Get the named value.
- Parameters:
-
| [in] | aField | Name of the field (column name). |
- Returns:
- The current value, or QVariant() in case there is no such field.
The documentation for this class was generated from the following file: