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

Container for VariantTableModel. More...

#include <VariantTableModelRow.h>

Public Member Functions

 VariantTableModelRow (VariantTableModelStorageRule storageRule, int colCount)
 Construct a row with colCount columns.
 
int columnCount () const
 Get column count.
 
QVariant data (int column, int role) const
 Get data at column. More...
 
void setItemEnabled (int column, bool enable)
 Set item enabled at column. More...
 
void setItemEditable (int column, bool editable)
 Set item editable at column. More...
 
Qt::ItemFlags flags (int column, Qt::ItemFlags currentFlags) const
 Get flags at column. More...
 
void setData (int column, const QVariant &value, int role=Qt::EditRole)
 Set data at column. More...
 
void resize (int columns, VariantTableModelStorageRule storageRule)
 Resize row to columns count of columns. More...
 
void insertColumns (int column, int count, VariantTableModelStorageRule storageRule)
 Insert count columns before column. More...
 
void removeColumns (int column, int count)
 Remove count columns starting with column. More...
 

Detailed Description

Container for VariantTableModel.

Definition at line 32 of file VariantTableModelRow.h.

Member Function Documentation

QVariant Mdt::ItemModel::VariantTableModelRow::data ( int  column,
int  role 
) const
inline

Get data at column.

If storage rule (passed in constructor) is SeparateDisplayAndEditRoleData, data for Qt::EditRole will be distinct from data for Qt::DisplayRole.

Precondition
column must be in valid range ( 0 <= column < columnCount() )
role must be Qt::DisplayRole or Qt::EditRole

Definition at line 59 of file VariantTableModelRow.h.

Qt::ItemFlags Mdt::ItemModel::VariantTableModelRow::flags ( int  column,
Qt::ItemFlags  currentFlags 
) const
inline

Get flags at column.

Returns currentFlags with Qt::ItemIsEditable and ItemIsEnabled set or unset regarding what was set ba setItemEditable() and setItemEnabled().

Precondition
column must be in valid range ( 0 <= column < columnCount() )

Definition at line 99 of file VariantTableModelRow.h.

void Mdt::ItemModel::VariantTableModelRow::insertColumns ( int  column,
int  count,
VariantTableModelStorageRule  storageRule 
)
inline

Insert count columns before column.

If column is 0, new columns are prepended. If column is columnCount(), columns are appended.

Precondition
column must be in correct range ( 0 <= column <= columnCount() )
count must be >= 1

Definition at line 145 of file VariantTableModelRow.h.

void Mdt::ItemModel::VariantTableModelRow::removeColumns ( int  column,
int  count 
)
inline

Remove count columns starting with column.

Precondition
column must be >= 0
count must be >= 1
column + count must be in correct range ( 0 <= column <= columnCount() )

Definition at line 159 of file VariantTableModelRow.h.

void Mdt::ItemModel::VariantTableModelRow::resize ( int  columns,
VariantTableModelStorageRule  storageRule 
)
inline

Resize row to columns count of columns.

For new count columns that is greater than current count, new null elements are added. For count that is less than current one, elements are removed.

Precondition
columns must be >= 0

Definition at line 131 of file VariantTableModelRow.h.

void Mdt::ItemModel::VariantTableModelRow::setData ( int  column,
const QVariant &  value,
int  role = Qt::EditRole 
)
inline

Set data at column.

If storage rule (passed in constructor) is SeparateDisplayAndEditRoleData, data for Qt::EditRole will be distinct from data for Qt::DisplayRole.

Precondition
column must be in valid range ( 0 <= column < columnCount() )
role must be Qt::DisplayRole or Qt::EditRole

Definition at line 115 of file VariantTableModelRow.h.

void Mdt::ItemModel::VariantTableModelRow::setItemEditable ( int  column,
bool  editable 
)
inline

Set item editable at column.

Precondition
column must be in valid range ( 0 <= column < columnCount() )

Definition at line 84 of file VariantTableModelRow.h.

void Mdt::ItemModel::VariantTableModelRow::setItemEnabled ( int  column,
bool  enable 
)
inline

Set item enabled at column.

Precondition
column must be in valid range ( 0 <= column < columnCount() )

Definition at line 72 of file VariantTableModelRow.h.


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