![]() |
VR-Forces 4.0.4 Class Documentation
|
As of Qt 4.4, QTimers no longer allow recursion. More...

Classes | |
| struct | TimerInfo |
Public Member Functions | |
| DtRecursiveTimer (QObject *parent=0) | |
| ~DtRecursiveTimer () | |
| int | start (QObject *object, int duration, bool singleShot=false) |
| Starts a timer. | |
| void | stop (int id) |
Private Slots | |
| void | onTimerInvoked () |
| Generates the QTimerEvents. | |
Private Attributes | |
| QMap< QTimer *, TimerInfo > | timers |
| int | counter |
As of Qt 4.4, QTimers no longer allow recursion.
This class is based on a work-around from TrollTech. It is used by DtTMApplication and DtVrf3DGuiApplication. It operates by posting new QTimerEvents to the QApplication's event queue. To receive the events derived classes must override QObject::timerEvent and check to see if the timerId matches the one returned by start(). If not, it should be passed down to the base class.
| DtRecursiveTimer::DtRecursiveTimer | ( | QObject * | parent = 0 | ) | [inline] |
| DtRecursiveTimer::~DtRecursiveTimer | ( | ) | [inline] |
| int DtRecursiveTimer::start | ( | QObject * | object, |
| int | duration, | ||
| bool | singleShot = false |
||
| ) | [inline] |
Starts a timer.
| object | the parent object, usually "this" |
| duration | counter time in miliseconds |
| singleShot | if true the timer will only fire once |
References DtRecursiveTimer::TimerInfo::id, DtRecursiveTimer::TimerInfo::object, and DtRecursiveTimer::TimerInfo::singleShot.
| void DtRecursiveTimer::stop | ( | int | id | ) | [inline] |
| void DtRecursiveTimer::onTimerInvoked | ( | ) | [inline, private, slot] |
Generates the QTimerEvents.
QMap<QTimer *, TimerInfo> DtRecursiveTimer::timers [private] |
int DtRecursiveTimer::counter [private] |