Results 1 to 2 of 2

Thread: QTimer while computer is asleep

  1. #1
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default QTimer while computer is asleep

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QTimer while computer is asleep

    Quote Originally Posted by Momergil View Post
    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    Momergil (5th October 2013)

Similar Threads

  1. Replies: 1
    Last Post: 25th October 2012, 19:47
  2. Replies: 15
    Last Post: 4th August 2012, 19:11
  3. Run my program on a different computer?
    By skizzik in forum Installation and Deployment
    Replies: 18
    Last Post: 12th November 2010, 14:26
  4. Turn off computer
    By swiety in forum KDE Forum
    Replies: 1
    Last Post: 5th January 2008, 15:40

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.