PDA

View Full Version : QTimer while computer is asleep



Momergil
11th September 2013, 18:08
Hello!

I'ld like to know more about QTimer behaviour in case the computer is put to sleep while a timer was active...

More specifically, suppose that I instantiate a QTimer::singlshot() to be triggered in 30 minutes and then I put the computer to Sleep with the software still opened. If I awake my computer before the 30 minutes has passed, will the QTimer notice the event and triggers at the same time I had calculated for it to do so? Or the QTimer counter pauses when the computer is put to Sleep and when reawakened, it it continue to count from where it paused and so will trigger a delayed time?

And what if I put my computer to Sleep and reawake it after the 30 minutes has passed. What will happen? It will immediately trigger, will not trigger or will continue to count and trigger later in a mistaken moment?

Thanks,

Momergil

wysota
13th September 2013, 18:54
If I awake my computer before the 30 minutes has passed, will the QTimer notice the event and triggers at the same time I had calculated for it to do so?
Yes.


Or the QTimer counter pauses
No.


It will immediately trigger
Yes.

Of course you should verify all what I said with a very simple example (which is what you should have done instead of asking this question here). I'm just guessing.