mirror of
https://github.com/Indy970/QtHPConnect
synced 2025-02-05 08:46:22 +01:00
25 lines
497 B
C++
25 lines
497 B
C++
#include "eventthread.h"
|
|
#include <QTimer>
|
|
#include "mainwindow.h"
|
|
|
|
EventThread::EventThread(MainWindow * parent)
|
|
{
|
|
main=parent;
|
|
if (main)
|
|
hpapi=main->getAPI();
|
|
}
|
|
|
|
void EventThread::timerEvent()
|
|
{
|
|
if(hpapi) {
|
|
// qDebug()<<"In Eventhandler";
|
|
hpapi->eventHandler();
|
|
}
|
|
}
|
|
|
|
void EventThread::start() {
|
|
QTimer* timer = new QTimer(this);
|
|
timer->setInterval(100);
|
|
timer->connect(timer, SIGNAL(timeout()), this, SLOT(timerEvent()));
|
|
timer->start();
|
|
}
|