QTfrontend/util/frontlibpoller.cpp
author Mitchell Kember <mk12360@gmail.com>
Tue, 04 Dec 2012 16:53:47 -0500
branchflibqtfrontend
changeset 8248 34d1aceb31aa
parent 8100 0e6fadf81a2c
permissions -rw-r--r--
Cleaned up frontend options a bit and added a couple WhatsThis messages.

#include <QTimerEvent>

#include "frontlibpoller.h"

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

    if(m_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);
}