#include "Thread.h"
#include <QtGui>
#include "thread.h"

void Thread::run() {
   timer = new QTimer(this);
   connect( timer, SIGNAL(timeout()), this, SLOT(threadAction()) );
   timer->start(1000);  // alle 1000 ms ein Methodenaufruf
   exec();
}

void Thread::threadAction() {
    QTime t = QTime::currentTime();

    QFile file("test.txt");
    file.open(QIODevice::WriteOnly | QIODevice::Text);
    //file.write( "Sekunde = " << t.second()  );
    file.write( "Sekunde = 123\n" );
    file.close();
}

void Thread::threadStop() {
    timer->stop();
    quit();
}
