author | unc0rr |
Sun, 25 Nov 2012 22:17:11 +0400 | |
branch | flibqtfrontend |
changeset 8103 | c247346d296f |
parent 8100 | 0e6fadf81a2c |
permissions | -rw-r--r-- |
8092 | 1 |
#include <QTimerEvent> |
2 |
||
3 |
#include "frontlibpoller.h" |
|
4 |
||
5 |
FrontLibPoller::FrontLibPoller(void (*poll)(void * data), void *data, QObject *parent) : |
|
6 |
QObject(parent) |
|
7 |
{ |
|
8 |
m_poll = poll; |
|
9 |
m_data = data; |
|
10 |
||
8100 | 11 |
if(m_data) |
12 |
m_timer.start(50, this); |
|
8092 | 13 |
} |
14 |
||
15 |
void FrontLibPoller::timerEvent(QTimerEvent *event) |
|
16 |
{ |
|
17 |
if(event->timerId() == m_timer.timerId()) |
|
18 |
m_poll(m_data); |
|
19 |
else |
|
20 |
QObject::timerEvent(event); |
|
21 |
} |