Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::InformationListIdModel Class Referencefinal

List model for a sf::InformationBase list. More...

#include <InformationListIdModel.h>

Inheritance diagram for sf::InformationListIdModel:
Collaboration diagram for sf::InformationListIdModel:

Classes

class  Entry
 

Public Types

enum  EField : int { cId , cType , cPurpose , cNamePath }
 Displayable columns. More...
 
typedef QList< Entry * > ListType
 Type for containing the information for this model.
 

Public Member Functions

 InformationListIdModel (QObject *parent=nullptr)
 Constructor.
 
 ~InformationListIdModel () override
 Constructor.
 
int nameLevel () const
 Gets the levels of names displayed of the variables in the list.
 
void setNameLevel (int level)
 Sets the levels of names displayed of the variables in the list.
 
void setItemDelegate (QAbstractItemView *view)
 Creates a sf::CommonItemDelegate instance for the passed view.
 
void refresh ()
 Refresh the attached viewer.
 
EField getField (int column) const
 Gets the field displayed in the column.
 
int getColumn (EField field) const
 Gets the column position or number where the field is displayed.
 
void update (int row=-1, int column=-1, const QList< int > &roles={})
 Update values in the given column and row.
 
void updateField (int row, EField field, const QList< int > &roles={})
 Update the column for the given field for all rows.
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const override
 Overridden from base class to provide column display names.
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 Overridden from base class to provide the amount of rows.
 
QVariant data (const QModelIndex &index, int role) const override
 Overridden from base class to provide the data to present.
 
int columnCount (const QModelIndex &parent={}) const override
 Overridden from base class to provide the amount of columns.
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 Overridden from base class to provide flags on an item by index.
 
void addEntry (InformationBase *info_base, const QString &purpose, const QString &tip={})
 Adds an entry to the list with pointer to the instance actually changed.
 
void addEntry (gii::TypeId type_id, gii::IdType *id, const QString &purpose, const QString &tip)
 Adds an entry to the list only by id and type.
 
void clearEntries ()
 Clear the variables added.
 
const ListTypegetList () const
 Gets the entry list of the model.
 
bool setData (const QModelIndex &index, const QVariant &value, int role) override
 Overridden from base class to provide assignment of an item when edited.
 
Q_SIGNAL void changed (const Entry *entry)
 Signals a change of the Variable's property.
 

Detailed Description

List model for a sf::InformationBase list.

Member Typedef Documentation

◆ ListType

Type for containing the information for this model.

Member Enumeration Documentation

◆ EField

Displayable columns.

Enumerator
cId 

Desired id of the information item.

cType 

Type of the information item.

cPurpose 

Purpose of the item for the user to base the selection on.

cNamePath 

Current name path of the information item.

Constructor & Destructor Documentation

◆ InformationListIdModel()

sf::InformationListIdModel::InformationListIdModel ( QObject *  parent = nullptr)
explicit

Constructor.

◆ ~InformationListIdModel()

sf::InformationListIdModel::~InformationListIdModel ( )
override

Constructor.

Member Function Documentation

◆ addEntry() [1/2]

void sf::InformationListIdModel::addEntry ( gii::TypeId  type_id,
gii::IdType id,
const QString &  purpose,
const QString &  tip 
)

Adds an entry to the list only by id and type.

Parameters
type_idType of the id .
idCurrent id for this instance.
purposeIndicating the purpose of this object.
tipAdditional optional information on the purpose.

◆ addEntry() [2/2]

void sf::InformationListIdModel::addEntry ( InformationBase info_base,
const QString &  purpose,
const QString &  tip = {} 
)

Adds an entry to the list with pointer to the instance actually changed.

Parameters
info_baseInformation object pointer of sf::Variable or sf::ResultData.
purposeIndicating the purpose of this object.
tipAdditional optional information on the purpose.

◆ changed()

Q_SIGNAL void sf::InformationListIdModel::changed ( const Entry entry)

Signals a change of the Variable's property.

Parameters
entryEntry in the list.

◆ clearEntries()

void sf::InformationListIdModel::clearEntries ( )

Clear the variables added.

◆ columnCount()

int sf::InformationListIdModel::columnCount ( const QModelIndex &  parent = {}) const
override

Overridden from base class to provide the amount of columns.

◆ data()

QVariant sf::InformationListIdModel::data ( const QModelIndex &  index,
int  role 
) const
override

Overridden from base class to provide the data to present.

◆ flags()

Qt::ItemFlags sf::InformationListIdModel::flags ( const QModelIndex &  index) const
override

Overridden from base class to provide flags on an item by index.

◆ getColumn()

int sf::InformationListIdModel::getColumn ( EField  field) const

Gets the column position or number where the field is displayed.

Parameters
field
Returns
-1 when field is not displayed.

◆ getField()

EField sf::InformationListIdModel::getField ( int  column) const

Gets the field displayed in the column.

Parameters
columnPosition or number of the column
Returns
Field displayed.

◆ getList()

const ListType & sf::InformationListIdModel::getList ( ) const

Gets the entry list of the model.

◆ headerData()

QVariant sf::InformationListIdModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role 
) const
override

Overridden from base class to provide column display names.

◆ nameLevel()

int sf::InformationListIdModel::nameLevel ( ) const

Gets the levels of names displayed of the variables in the list.

◆ refresh()

void sf::InformationListIdModel::refresh ( )

Refresh the attached viewer.

◆ rowCount()

int sf::InformationListIdModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

Overridden from base class to provide the amount of rows.

◆ setData()

bool sf::InformationListIdModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role 
)
override

Overridden from base class to provide assignment of an item when edited.

◆ setItemDelegate()

void sf::InformationListIdModel::setItemDelegate ( QAbstractItemView *  view)

Creates a sf::CommonItemDelegate instance for the passed view.

◆ setNameLevel()

void sf::InformationListIdModel::setNameLevel ( int  level)

Sets the levels of names displayed of the variables in the list.

◆ update()

void sf::InformationListIdModel::update ( int  row = -1,
int  column = -1,
const QList< int > &  roles = {} 
)

Update values in the given column and row.

Parameters
rowWhen -1 all rows are selected.
columnWhen -1 all columns are selected.
rolesRoles to update.

◆ updateField()

void sf::InformationListIdModel::updateField ( int  row,
EField  field,
const QList< int > &  roles = {} 
)

Update the column for the given field for all rows.

Parameters
rowWhen -1 all rows are selected.
fieldTranslated to the column containing the field.
rolesRoles to update.

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