Items used by BpsTableModel.
More...
#include <bpstableitem.h>
|
class | BpsTableModel |
|
class | BpsTableModelPrivate |
|
Items used by BpsTableModel.
◆ CacheIndex
Reserved cache indexes.
Enumerator |
---|
CacheDisplayColumnStart | This plus field count subsequent values are for display caching.
|
◆ Status
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.
|
◆ addFields()
void BpsTableItem::addFields |
( |
const QSqlRecord & |
aRecord | ) |
|
Add more fields to the record.
- Parameters
-
aRecord | The record containing the additional fields. |
◆ cache() [1/2]
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
-
aField | Name of the field (column name). |
- Returns
- The current cache value, or QVariant() in case there is no such cached value.
◆ cache() [2/2]
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
-
aIndex | Index of the cached value. |
- Returns
- The current cache value, or QVariant() in case there is no such cached value.
◆ changedValues()
QVariantMap BpsTableItem::changedValues |
( |
| ) |
const |
- Returns
- List of all changed values.
◆ data()
QVariant BpsTableItem::data |
( |
int |
aIndex = 0 | ) |
const |
Get application data.
The application data is not used by QTableModel but available for the applications use. It is not necessary related to distinct column values and may be used to store any additional information not saved in the database.
- Parameters
-
- Returns
- The data, or an invalid QVariant if not set.
◆ hasField()
bool BpsTableItem::hasField |
( |
const QString & |
aField | ) |
|
Check if the field is present.
- Parameters
-
aField | The field (column) name. |
- Returns
- True if field is in record, false otherwise.
◆ hasOptions()
bool BpsTableItem::hasOptions |
( |
const QString & |
aTable | ) |
|
Check if the options are present.
- Parameters
-
aTable | Name of the options table. |
- Returns
- True if options are present, false otherwise.
◆ isEditable()
bool BpsTableItem::isEditable |
( |
| ) |
const |
- Returns
- True if the field can be edited.
◆ options()
Get the named option key set.
- Parameters
-
aMappingTable | The name of the mapping table with the options. |
- Returns
- The option set, or an empty set in case of invalid table name.
◆ setCache() [1/2]
void BpsTableItem::setCache |
( |
const QString & |
aField, |
|
|
const QVariant & |
aValue |
|
) |
| |
Set the cache value of the named field.
- Parameters
-
aField | Name of the field (column name). |
aValue | The new cache value to set. Set QVariant() to clear the cache. |
◆ setCache() [2/2]
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
-
aIndex | Index of the cached value. |
aValue | The cached value. Set QVariant() to clear the cache. |
◆ setData()
void BpsTableItem::setData |
( |
const QVariant & |
aValue, |
|
|
int |
aIndex = 0 |
|
) |
| |
Set application data.
- Parameters
-
aValue | The value to set. A invalid QVariant clears the data. |
aIndex | The data index. |
◆ setIsEditable()
void BpsTableItem::setIsEditable |
( |
bool |
aIsEditable | ) |
|
Enable / disable editing of a field.
Initially items are enabled for editing.
- Parameters
-
aIsEditable | The new editable status. |
◆ setOptions()
Set the options of the named set.
- Parameters
-
aMappingTable | The name of the mapping table with the options. |
aOptions | The new options to set |
- Returns
- True if the options was changed, false if invalid table or options were already same.
◆ setValue()
bool BpsTableItem::setValue |
( |
const QString & |
aField, |
|
|
const QVariant & |
aValue |
|
) |
| |
Set the value of the named field.
- Parameters
-
aField | Name of the field (column name). |
aValue | The new value to set |
- Returns
- True if the value was changed, false if invalid field name or value was already same.
◆ slaveModel()
Get the named slave table model.
- Parameters
-
aTable | Table name of the desired slave model. |
- Returns
- Model pointer, or 0 if no such slave model.
◆ status()
Status BpsTableItem::status |
( |
| ) |
const |
- Returns
- The current status.
◆ value()
Get the named value.
- Parameters
-
aField | Name of the field (column name). |
- Returns
- The current value, or QVariant() in case there is no such field.
◆ values()
QVariantMap BpsTableItem::values |
( |
| ) |
const |
- Returns
- List of all values.
The documentation for this class was generated from the following file: