author | unc0rr |
Wed, 05 Dec 2012 23:55:22 +0400 | |
branch | flibqtfrontend |
changeset 8233 | d3966a555e5e |
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 |
} |