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.

Qt Code:
  1. void Infusion::GetDuration()
  2. {
  3. int x;
  4. x=InfusionTime.secsTo(CurrentTime);
  5. }
To copy to clipboard, switch view to plain text mode 

i also include
Qt Code:
  1. QTimer *duration= new QTimer(this);
  2. connect(duration, SIGNAL(timeout()),this, SLOT(GetDuration()));
  3. Stopwatch.start(); //QTime Stopwatch; in header file
  4. 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