Hello all ,
I am trying to make a stopwatch for my GUI when i click the start button
I been Researching and tried out alot of examples in the internet.I tried to minus the the current time (InfusionTime)minus the time(CurrentTime) i click on the button by using.
void Infusion::GetDuration()
{
int x;
x=InfusionTime.secsTo(CurrentTime);
}
void Infusion::GetDuration()
{
int x;
x=InfusionTime.secsTo(CurrentTime);
}
To copy to clipboard, switch view to plain text mode
i also include
connect(duration, SIGNAL(timeout()),this, SLOT(GetDuration()));
Stopwatch.start(); //QTime Stopwatch; in header file
duration->start(50);
QTimer *duration= new QTimer(this);
connect(duration, SIGNAL(timeout()),this, SLOT(GetDuration()));
Stopwatch.start(); //QTime Stopwatch; in header file
duration->start(50);
To copy to clipboard, switch view to plain text mode
to check for the number everytime.
But I think i am doing it wrong as whenever i click the button . I keep getting the current time which is not moving(eg. Time Stamp)
Can anyone help me ? Or maybe teach me another way to implement a stopwatch in my gui.
Thanks
Bookmarks