All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
#include <ThreadTimer.h>
Public Slots | |
void | synchronize () |
void | threadStarted () |
void | threadStopped () |
Signals | |
void | synchroTimeout () |
Public Member Functions | |
int | nRunningThreads () |
ThreadTimer () | |
~ThreadTimer () |
References synchronize(), and TRACE.
{ TRACE; _nofRunningThreads=0; connect((QTimer*)this,SIGNAL(timeout()),this,SLOT(synchronize())); setSingleShot(true); }
QGpCoreTools::ThreadTimer::~ThreadTimer | ( | ) | [inline] |
{}
int QGpCoreTools::ThreadTimer::nRunningThreads | ( | ) | [inline] |
{return _nofRunningThreads;}
void QGpCoreTools::ThreadTimer::synchronize | ( | ) | [slot] |
References synchroTimeout(), and TRACE.
Referenced by ThreadTimer().
{ TRACE; QTime chrono; chrono.start(); emit synchroTimeout(); QCoreApplication::processEvents(); int updateDelay=5*chrono.elapsed(); if(updateDelay<1000) updateDelay=1000; start(updateDelay); }
void QGpCoreTools::ThreadTimer::synchroTimeout | ( | ) | [signal] |
Referenced by synchronize(), and threadStopped().
void QGpCoreTools::ThreadTimer::threadStarted | ( | ) | [slot] |
void QGpCoreTools::ThreadTimer::threadStopped | ( | ) | [slot] |
References synchroTimeout(), and TRACE.
{ TRACE; _nofRunningThreads--; if(_nofRunningThreads<=0) { stop(); QTimer::singleShot(500, this, SIGNAL(synchroTimeout())); } }