itom  4.1.0
ito::TimerModel Class Reference

model for management of all timer objects. This model will be is used as model for the view in the timer manager. More...

Inheritance diagram for ito::TimerModel:

Classes

struct  TimerItem
 item of TimerModel More...
 

Public Member Functions

 TimerModel ()
 constructor More...
 
 ~TimerModel ()
 destructor
 
QVariant data (const QModelIndex &index, int role) const
 overwritten data method of QAbstractItemModel More...
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const
 returns QModelIndex for given row and column More...
 
QModelIndex parent (const QModelIndex &index) const
 returns parent of given QModelIndex More...
 
int rowCount (const QModelIndex &parent=QModelIndex()) const
 counts number of bookmarks in this model More...
 
int columnCount (const QModelIndex &parent=QModelIndex()) const
 counts number of columns in this model (corresponds to number of header-elements) More...
 
void registerNewTimer (const QWeakPointer< QTimer > &timer, const QString &name)
 
void updateTimerData ()
 
void autoUpdateModel (bool enabled)
 
void timerStart (const QModelIndex &index)
 
void timerStop (const QModelIndex &index)
 
void timerStopAll ()
 

Protected Member Functions

QVariant headerData (int section, Qt::Orientation orientation, int role) const
 returns header element at given position More...
 
void timerEvent (QTimerEvent *ev)
 

Private Slots

void timerDestroyed (QObject *timer)
 

Private Member Functions

bool cacheItem (TimerItem &item)
 

Private Attributes

QList< TimerItemm_timers
 
int m_timerId
 
int m_enableCount
 
QIcon m_iconRunning
 
QIcon m_iconStopped
 
QIcon m_iconUnknown
 

Detailed Description

model for management of all timer objects. This model will be is used as model for the view in the timer manager.

Constructor & Destructor Documentation

ito::TimerModel::TimerModel ( )

constructor

initializes headers and its alignment

Member Function Documentation

bool ito::TimerModel::cacheItem ( TimerItem item)
private

list of timers (TimerItem) which are currently available in this application

int ito::TimerModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const

counts number of columns in this model (corresponds to number of header-elements)

Returns
number of columns
QVariant ito::TimerModel::data ( const QModelIndex &  index,
int  role 
) const

overwritten data method of QAbstractItemModel

data method will be called by View-Widget in order to fill the table.

Parameters
indexQModelIndex of item, whose content should be returned
Returns
content of desired item and column
QVariant ito::TimerModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role 
) const
protected

returns header element at given position

Parameters
sectionposition in m_headers list
orientationthe model's orientation should be horizontal, no other orientation is supported
rolemodel is only prepared for DisplayRole
Returns
name of header or empty QVariant value (if no header element available)
QModelIndex ito::TimerModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const

returns QModelIndex for given row and column

Parameters
rowrow of desired entry, corresponds to index in m_bookmarks list
columncolumn of desired entry
parentsince this model is no tree model, parent always points to a "virtual" root element
Returns
empty QModelIndex if row or column are out of bound, else returns new valid QModelIndex for that combination of row and column
QModelIndex ito::TimerModel::parent ( const QModelIndex &  index) const

returns parent of given QModelIndex

since this model is not a tree model, returns always an empty QModelIndex

int ito::TimerModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const

counts number of bookmarks in this model

Returns
number of elements

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