QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
FreeTerminalModel Class Reference

The FreeTerminalModel class. More...

#include <freeterminalmodel.h>

Inherits QAbstractTableModel.

Collaboration diagram for FreeTerminalModel:
Collaboration graph

Public Types

enum  Column {
  Label = 0 , XRef = 1 , Type = 2 , Function = 3 ,
  Led = 4 , Invalid = 99
}

Public Member Functions

 FreeTerminalModel (QETProject *project, QObject *parent=nullptr)
 FreeTerminalModel::FreeTerminalModel.
void setProject (QETProject *project)
 FreeTerminalModel::setProject Set @project as project handled by this model. If a previous project was setted, everything is clear. This function track the destruction of the project, that mean if the project pointer is deleted no need to call this function with a nullptr, everything is made inside this class.
int rowCount (const QModelIndex &parent) const override
 FreeTerminalModel::rowCount.
int columnCount (const QModelIndex &parent) const override
 FreeTerminalModel::columnCount.
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 FreeTerminalModel::data.
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 FreeTerminalModel::headerData.
Qt::ItemFlags flags (const QModelIndex &index) const override
void clear ()
 FreeTerminalModel::clear Clear the model and set it as the current state of the project.
QVector< modelRealTerminalDatamodifiedModelRealTerminalData () const
 FreeTerminalModel::modifiedModelRealTerminalData.
modelRealTerminalData dataAtRow (int row) const
 FreeTerminalModel::dataAtRow.
QVector< QSharedPointer< RealTerminal > > realTerminalForIndex (const QModelIndexList &index_list) const
 FreeTerminalModel::realTerminalForIndex.

Static Public Member Functions

static FreeTerminalModel::Column columnTypeForIndex (const QModelIndex &index)

Private Member Functions

void fillTerminalVector ()
 FreeTerminalModel::fillTerminalVector.

Private Attributes

QPointer< QETProjectm_project
QVector< QSharedPointer< RealTerminal > > m_terminal_vector
QVector< modelRealTerminalDatam_real_t_data
QHash< QSharedPointer< RealTerminal >, QVector< bool > > m_modified_cell

Detailed Description

The FreeTerminalModel class.

Member Enumeration Documentation

◆ Column

Enumerator
Label 
XRef 
Type 
Function 
Led 
Invalid 

Constructor & Destructor Documentation

◆ FreeTerminalModel()

FreeTerminalModel::FreeTerminalModel ( QETProject * project,
QObject * parent = nullptr )
explicit

FreeTerminalModel::FreeTerminalModel.

Parameters
project
parent
Here is the call graph for this function:

Member Function Documentation

◆ clear()

void FreeTerminalModel::clear ( )

FreeTerminalModel::clear Clear the model and set it as the current state of the project.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ columnCount()

int FreeTerminalModel::columnCount ( const QModelIndex & parent) const
override

FreeTerminalModel::columnCount.

Parameters
parent

◆ columnTypeForIndex()

FreeTerminalModel::Column FreeTerminalModel::columnTypeForIndex ( const QModelIndex & index)
static

◆ data()

QVariant FreeTerminalModel::data ( const QModelIndex & index,
int role = Qt::DisplayRole ) const
override

FreeTerminalModel::data.

Parameters
index
role
Returns
Here is the call graph for this function:

◆ dataAtRow()

modelRealTerminalData FreeTerminalModel::dataAtRow ( int row) const

FreeTerminalModel::dataAtRow.

Parameters
row
Returns
the current data at row row
Here is the caller graph for this function:

◆ fillTerminalVector()

void FreeTerminalModel::fillTerminalVector ( )
private

FreeTerminalModel::fillTerminalVector.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ flags()

Qt::ItemFlags FreeTerminalModel::flags ( const QModelIndex & index) const
override
Here is the call graph for this function:
Here is the caller graph for this function:

◆ headerData()

QVariant FreeTerminalModel::headerData ( int section,
Qt::Orientation orientation,
int role = Qt::DisplayRole ) const
override

FreeTerminalModel::headerData.

Parameters
section
orientation
role
Returns

◆ modifiedModelRealTerminalData()

QVector< modelRealTerminalData > FreeTerminalModel::modifiedModelRealTerminalData ( ) const

FreeTerminalModel::modifiedModelRealTerminalData.

Returns
a vector of modified terminal.

◆ realTerminalForIndex()

QVector< QSharedPointer< RealTerminal > > FreeTerminalModel::realTerminalForIndex ( const QModelIndexList & index_list) const

FreeTerminalModel::realTerminalForIndex.

Parameters
index_list
Returns
The QSharedPointer<RealTerminal> associated with the index found in index_list

◆ rowCount()

int FreeTerminalModel::rowCount ( const QModelIndex & parent) const
override

FreeTerminalModel::rowCount.

Parameters
parent
Here is the caller graph for this function:

◆ setData()

bool FreeTerminalModel::setData ( const QModelIndex & index,
const QVariant & value,
int role = Qt::EditRole )
override
Here is the call graph for this function:

◆ setProject()

void FreeTerminalModel::setProject ( QETProject * project)

FreeTerminalModel::setProject Set @project as project handled by this model. If a previous project was setted, everything is clear. This function track the destruction of the project, that mean if the project pointer is deleted no need to call this function with a nullptr, everything is made inside this class.

Parameters
project
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_modified_cell

QHash<QSharedPointer<RealTerminal>, QVector<bool> > FreeTerminalModel::m_modified_cell
private

◆ m_project

QPointer<QETProject> FreeTerminalModel::m_project
private

◆ m_real_t_data

QVector<modelRealTerminalData> FreeTerminalModel::m_real_t_data
private

◆ m_terminal_vector

QVector<QSharedPointer<RealTerminal> > FreeTerminalModel::m_terminal_vector
private

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