FactDev  0.1
Gui::Widgets::WdgModels::ContributoriesTableModel Class Reference

The ContributoriesTableModel class for a custom table for contributories widget. More...

#include <contributoriestablemodel.h>

Inheritance diagram for Gui::Widgets::WdgModels::ContributoriesTableModel:

Public Member Functions

 ContributoriesTableModel (QObject *parent=0)
 ContributoriesTableModel::ContributoriesTableModel Construct a ContributoriesTableModel. More...
 
int rowCount (const QModelIndex &) const
 ContributoriesTableModel::rowCount Number of contributories row. More...
 
int columnCount (const QModelIndex &) const
 ContributoriesTableModel::columnCount Number of column of a contributory. More...
 
QVariant data (const QModelIndex &index, int role) const
 ContributoriesTableModel::data Obtains data of a specify cell. More...
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const
 ContributoriesTableModel::headerData Obtains header title of table. More...
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
 ContributoriesTableModel::setData Change data of a cell. More...
 
void append (const Contributory &contributory)
 ContributoriesTableModel::append Add a new line in table. More...
 
void remove (const int i)
 ContributoriesTableModel::remove Remove a line. More...
 
Qt::ItemFlags flags (const QModelIndex &index) const
 ContributoriesTableModel::flags Differents table flags. More...
 
QList< ContributorygetContributories ()
 ContributoriesTableModel::getContributories Get all contributories of table. More...
 
int count ()
 ContributoriesTableModel::count Number of contributories in table. More...
 
double getSumQuantity () const
 ContributoriesTableModel::getSumQuantity Return the sum of the hours of all contriburoies added. More...
 
void clear ()
 ContributoriesTableModel::clear Remove all contributories.
 

Detailed Description

The ContributoriesTableModel class for a custom table for contributories widget.

Author
Antoine de Roquemaurel
See Also
Contributory

Constructor & Destructor Documentation

Gui::Widgets::WdgModels::ContributoriesTableModel::ContributoriesTableModel ( QObject *  parent = 0)

Member Function Documentation

void Gui::Widgets::WdgModels::ContributoriesTableModel::append ( const Contributory contributory)

ContributoriesTableModel::append Add a new line in table.

Parameters
contributoryThe new contributory
int Gui::Widgets::WdgModels::ContributoriesTableModel::columnCount ( const QModelIndex &  ) const

ContributoriesTableModel::columnCount Number of column of a contributory.

Returns
The number of column
int Gui::Widgets::WdgModels::ContributoriesTableModel::count ( )

ContributoriesTableModel::count Number of contributories in table.

Returns
The number of contributories
QVariant Gui::Widgets::WdgModels::ContributoriesTableModel::data ( const QModelIndex &  index,
int  role 
) const

ContributoriesTableModel::data Obtains data of a specify cell.

Parameters
indexThe cell who we want data
roleThe role of set
Returns
The data of cell
Qt::ItemFlags Gui::Widgets::WdgModels::ContributoriesTableModel::flags ( const QModelIndex &  index) const

ContributoriesTableModel::flags Differents table flags.

Parameters
indexThe cell who we want to know flags
Returns
Flags
QList< Contributory > Gui::Widgets::WdgModels::ContributoriesTableModel::getContributories ( )

ContributoriesTableModel::getContributories Get all contributories of table.

Returns
The contributory list
double Gui::Widgets::WdgModels::ContributoriesTableModel::getSumQuantity ( ) const

ContributoriesTableModel::getSumQuantity Return the sum of the hours of all contriburoies added.

Returns
sum quantity
QVariant Gui::Widgets::WdgModels::ContributoriesTableModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role 
) const

ContributoriesTableModel::headerData Obtains header title of table.

Parameters
sectionThe number of column
orientationThe table orientation
role
Returns
The Title header of column
void Gui::Widgets::WdgModels::ContributoriesTableModel::remove ( const int  i)

ContributoriesTableModel::remove Remove a line.

Parameters
iThe number of line to remove
int Gui::Widgets::WdgModels::ContributoriesTableModel::rowCount ( const QModelIndex &  ) const

ContributoriesTableModel::rowCount Number of contributories row.

Returns
The number of contributories
bool Gui::Widgets::WdgModels::ContributoriesTableModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)

ContributoriesTableModel::setData Change data of a cell.

Parameters
indexThe cell to change data
valueThe new value
roleTHe role of cell
Returns
True if we could edit

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