Faith::Timer Class Reference

Emits signals at regularly timed intervals. More...

#include <faith/timer.h>

Inheritance diagram for Faith::Timer:

Faith::Object List of all members.


void timeout ()

Public Member Functions

 Timer (Object *parent=0, const char *name=0)
bool isActive () const
void start (int msec, bool singleshot=false)
void changeInterval (int msec)
void stop ()

Static Public Member Functions

static void singleShot (int msec, Object *receiver, const char *member)

Protected Member Functions

void timerEvent (TimerEvent *)

Detailed Description

Emits signals at regularly timed intervals.

a Timer can be used for getting events in regular time intervals

Constructor & Destructor Documentation

Faith::Timer::Timer ( Object parent = 0,
const char *  name = 0 

Member Function Documentation

void Faith::Timer::changeInterval ( int  msec  ) 

Same as calling if (isActive()) start(msec, [singleshot])

bool Faith::Timer::isActive (  )  const

true if this class will emit the timeout() signal after some time, and false otherwise

static void Faith::Timer::singleShot ( int  msec,
Object receiver,
const char *  member 
) [static]

A handy function to have a slot called after a specified amount of time without any further action

msec is the approximate number of milliseconds until your slot will be called
receiver is the object with the slot
member is the slot you want called after the time specified
 // Calls this->later() in 1 second
 Faith::Timer::singleShot(1000, this, SLOT(later()))

void Faith::Timer::start ( int  msec,
bool  singleshot = false 

Make this object start to emit timeout signals.

msec is the approximate number of milliseconds between each signal
singleshot should be set to true if you only want to recieve only one signal before the Timer is deactivated.

void Faith::Timer::stop (  ) 

The Timer will be deactivated after calling this. No more signals will be emitted after calling this unless you call start again

void Faith::Timer::timeout (  )  [signal]

This signal is emitted after you call start in the set period of time

See also:

void Faith::Timer::timerEvent ( TimerEvent  )  [protected, virtual]

Receives timer events as created by startTimer

Reimplemented from Faith::Object.

The documentation for this class was generated from the following file:
Generated on Fri Sep 1 00:23:09 2006 for Faith by  doxygen 1.4.7