Multi diag tools
Public Member Functions | List of all members
Mdt::ItemModel::VariantTableModelItem Class Reference

Item of a VariantTableModel. More...

#include <VariantTableModelItem.h>

Public Member Functions

 VariantTableModelItem (VariantTableModelStorageRule storageRule)
 Construct a item.
 
bool isEditRoleDataSeparate () const
 Check if edit role data is stored separately from display role data.
 
void setDisplayRoleData (const QVariant &data)
 Set data for display role.
 
QVariant displayRoleData () const
 Get data for display role.
 
void setEditRoleData (const QVariant &data)
 Set data for edit role. More...
 
QVariant editRoleData () const
 Get data for edit role. More...
 
void setData (const QVariant &data, int role)
 Set data. More...
 
QVariant data (int role) const
 Get data. More...
 
void setEnabled (bool enable)
 Set item enabled/disabled. More...
 
bool isEnabled () const
 Check if item is enabled.
 
void setEditable (bool editable)
 Set item editable/read only. More...
 
bool isEditable () const
 Check if item is editable.
 
Qt::ItemFlags flags (Qt::ItemFlags currentFlags) const
 Get flags. More...
 

Detailed Description

Item of a VariantTableModel.

Definition at line 32 of file VariantTableModelItem.h.

Member Function Documentation

QVariant Mdt::ItemModel::VariantTableModelItem::data ( int  role) const
inline

Get data.

Precondition
role must be Qt::DisplayRole or Qt::EditRole

Definition at line 92 of file VariantTableModelItem.h.

QVariant Mdt::ItemModel::VariantTableModelItem::editRoleData ( ) const
inline

Get data for edit role.

If isEditRoleDataSeparate() is true, returns data set by setEditRoleData(), else it returns the same as displayRoleData()

Definition at line 74 of file VariantTableModelItem.h.

Qt::ItemFlags Mdt::ItemModel::VariantTableModelItem::flags ( Qt::ItemFlags  currentFlags) const

Get flags.

Returns currentFlags with Qt::ItemIsEditable and ItemIsEnabled set or unset regarding isEditable() and isEnabled().

Definition at line 53 of file VariantTableModelItem.cpp.

void Mdt::ItemModel::VariantTableModelItem::setData ( const QVariant &  data,
int  role 
)

Set data.

Precondition
role must be Qt::DisplayRole or Qt::EditRole

Definition at line 42 of file VariantTableModelItem.cpp.

void Mdt::ItemModel::VariantTableModelItem::setEditable ( bool  editable)
inline

Set item editable/read only.

Default id editable

Definition at line 123 of file VariantTableModelItem.h.

void Mdt::ItemModel::VariantTableModelItem::setEditRoleData ( const QVariant &  data)

Set data for edit role.

If isEditRoleDataSeparate() is false, this will be the same as setDisplayRoleData()

Definition at line 33 of file VariantTableModelItem.cpp.

void Mdt::ItemModel::VariantTableModelItem::setEnabled ( bool  enable)
inline

Set item enabled/disabled.

Default is enabled

Definition at line 107 of file VariantTableModelItem.h.


The documentation for this class was generated from the following files: