I am using QT5 in visual studio.

I have the function below where I call singleShot for a some ms value according to the GUI (in this case 1000 ms). After single shot has passed it should call reset_TEER() and then rest some values and recall TEER(). This keeps the GUI responsive in-between measurements.

This works great, except that sometimes at 12:00 AM (midnight) singleshot never times out and the reset_TEER() is never called again. The last time I tried this it ran from 10:39AM 8/20 to 12:00AM 8/22. So, I expect Sunday is the problem, but I can't tell if Sunday is the only day that causes the problem because I have seen this happen once before (at the same midnight time). Other times it works for four days no problem.

Qt Code:
  1. void CLASS::reset_TEER(){
  2. //do stuff
  3. TEER();
  4. }
  5.  
  6. void CLASS::TEER(){
  7. for(){ //generic for loop here
  8. }
  9. TEER_count++;
  10. if (TEER_count < ui.num_cycles->value() && ui.enable_repeat->isChecked())
  11. QTimer::singleShot(ui.wait_num_cycles->value(), this, SLOT(reset_TEER()));
  12. }
To copy to clipboard, switch view to plain text mode 

I can't find any information about why singleShot would do this. I do see that QTime will return to zero after 24 hours but they don't seem related. Should I be doing this a different way?

Thanks for your input.