QTfrontend/util/frontlibpoller.cpp
author unc0rr
Thu, 22 Nov 2012 01:19:16 +0400
branchflibqtfrontend
changeset 8092 08960209db8c
child 8100 0e6fadf81a2c
permissions -rw-r--r--
Try to use map preview facilities: - HWGame and HWRecorder are completely broken - HWMap should work, but doesn't

#include <QTimerEvent>

#include "frontlibpoller.h"

FrontLibPoller::FrontLibPoller(void (*poll)(void * data), void *data, QObject *parent) :
    QObject(parent)
{
    m_poll = poll;
    m_data = data;

    m_timer.start(50, this);
}

void FrontLibPoller::timerEvent(QTimerEvent *event)
{
    if(event->timerId() == m_timer.timerId())
        m_poll(m_data);
    else
        QObject::timerEvent(event);
}