#include "timerExample.h"
#include <QtGui>
timerExample
::timerExample(QWidget *parent, Qt
::WFlags flags
){
ui.setupUi(this);
time = 0;
timeInterval = 1; // this sets the time interval at 1 millisecond
connect(timer, SIGNAL(timeout()), this, SLOT(update()));
}
void timerExample::update()
{
time = time + timeInterval;
}
void timerExample::on_threadStartButton_clicked()
{
timer->start(timeInterval);
}
void timerExample::on_threadStopButton_clicked()
{
timer->stop();
// writes out time taken to a LineEdit
ui.timeLine->setText(str);
}