itom
Loading...
Searching...
No Matches
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
 
 ~TimerModel ()
 destructor
 
QVariant data (const QModelIndex &index, int role) const
 overwritten data method of QAbstractItemModel
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const
 returns QModelIndex for given row and column
 
QModelIndex parent (const QModelIndex &index) const
 returns parent of given QModelIndex
 
int rowCount (const QModelIndex &parent=QModelIndex()) const
 counts number of bookmarks in this model
 
int columnCount (const QModelIndex &parent=QModelIndex()) const
 counts number of columns in this model (corresponds to number of header-elements)
 
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
 
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

◆ TimerModel()

ito::TimerModel::TimerModel ( )

constructor

initializes headers and its alignment

Member Function Documentation

◆ cacheItem()

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

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

◆ columnCount()

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

◆ data()

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

◆ headerData()

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)

◆ index()

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

◆ parent()

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

◆ rowCount()

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: