QDaq  0.2.6
Qt-based Data Aqcuisition
 All Classes Functions Variables Typedefs Enumerations Enumerator Properties Groups Pages
qtimerthread.cpp
1 #include "qtimerthread.h"
2 
3 QTimerThread::QTimerThread()
4 {
5  timer_.setInterval(1000);
6  timer_.setTimerType(Qt::PreciseTimer);
7  timer_.moveToThread(this);
8  connect(&timer_, SIGNAL(timeout()), this, SLOT(timer_func()), Qt::DirectConnection);
9 }
10 
11 QTimerThread::~QTimerThread()
12 {
13  quit();
14  wait();
15 }
16 
17 void QTimerThread::run()
18 {
19 
20  timer_.start();
21  QThread::run();
22  timer_.stop();
23 }