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

The CustomersTableModel class for a customer table. More...

#include <customerstablemodel.h>

Inheritance diagram for Gui::Widgets::WdgModels::CustomersTableModel:

Public Member Functions

 CustomersTableModel (QObject *parent=0)
 CustomersTableModel::CustomersTableModel Construct a CustomersTableModel. More...
 
int rowCount (const QModelIndex &) const
 CustomersTableModel::rowCount Number of customers row. More...
 
int columnCount (const QModelIndex &) const
 CustomersTableModel::columnCount Number of column of a customer. More...
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
 CustomersTableModel::data Obtains data of a specify cell. More...
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
 CustomersTableModel::headerData Obtains header title of table. More...
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
 CustomersTableModel::setData Change data of a cell. More...
 
void append (const Customer &customer)
 CustomersTableModel::append Add a new line in table. More...
 
void remove (const int i)
 CustomersTableModel::remove Remove a line. More...
 
Qt::ItemFlags flags (const QModelIndex &index) const
 CustomersTableModel::flags Differents table flags. More...
 
int count ()
 CustomersTableModel::count Number of customers in table. More...
 
QList< CustomergetCustomers () const
 CustomersTableModel::getCustomers Return the list of customers. More...
 

Detailed Description

The CustomersTableModel class for a customer table.

Author
Florent Berbie
See Also
Customer

Constructor & Destructor Documentation

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

CustomersTableModel::CustomersTableModel Construct a CustomersTableModel.

Parameters
parentParent widget

Member Function Documentation

void Gui::Widgets::WdgModels::CustomersTableModel::append ( const Customer customer)

CustomersTableModel::append Add a new line in table.

Parameters
CustomerThe new customer
int Gui::Widgets::WdgModels::CustomersTableModel::columnCount ( const QModelIndex &  ) const

CustomersTableModel::columnCount Number of column of a customer.

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

CustomersTableModel::count Number of customers in table.

Returns
The number of customers
QVariant Gui::Widgets::WdgModels::CustomersTableModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const

CustomersTableModel::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::CustomersTableModel::flags ( const QModelIndex &  index) const

CustomersTableModel::flags Differents table flags.

Parameters
indexThe cell who we want to know flags
Returns
Flags
QList< Customer > Gui::Widgets::WdgModels::CustomersTableModel::getCustomers ( ) const

CustomersTableModel::getCustomers Return the list of customers.

Returns
list of Customers
QVariant Gui::Widgets::WdgModels::CustomersTableModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const

CustomersTableModel::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::CustomersTableModel::remove ( const int  i)

CustomersTableModel::remove Remove a line.

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

CustomersTableModel::rowCount Number of customers row.

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

CustomersTableModel::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: