Results 1 to 9 of 9

Thread: how to use Multiple timers?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2012
    Posts
    32
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    18

    Default Re: how to use Multiple timers?

    Quote Originally Posted by Lesiok View Post
    I miss what is a problem.
    Simply You creates many QTimers and connect every of them to another slot.
    Just read QTimer class reference
    Hi Lesiok,

    I had done what you explained. But it was delaying the process.
    means 6 Qtimers created and connected to 6 diff slots with different timeouts.

    but i am the timers are getting delayed. As per my application i need to run all the timers at a time.

    sample code of mine is --

    1st timer -
    timer_HMIScrLvl4 = new QTimer(this);
    connect(timer_HMIScrLvl4, SIGNAL(timeout()), this, SLOT(update_HMIScrLvl4()));
    timer_HMIScrLvl4->setInterval(100);
    2nd timer -
    Timer_failure_display = new QTimer(this);
    connect(Timer_failure_display, SIGNAL(timeout()), this, SLOT(failure_display()));
    Timer_failure_display->setInterval(250);
    3rd timer -
    Timer_footer = new QTimer(this);
    connect(Timer_footer, SIGNAL(timeout()), this, SLOT(footer()));
    Timer_footer->setInterval(250);
    4th timer -
    Timer_diagonostic_refresh = new QTimer(this);
    connect(Timer_diagonostic_refresh, SIGNAL(timeout()), this, SLOT(diagonostic_refresh()));
    Timer_diagonostic_refresh->setInterval(50);
    5th Timer -
    Timer_information_refresh = new QTimer(this);
    connect(Timer_information_refresh, SIGNAL(timeout()), this, SLOT(information_refresh()));
    Timer_information_refresh->setInterval(25);
    6th timer -
    Timer_footer = new QTimer(this);
    connect(Timer_footer, SIGNAL(timeout()), this, SLOT(footer()));
    Timer_footer->setInterval(250);
    1st & 2nd timers are the main timers i should not wanted them to be delayed, they should run at a time.

    Thanks in Advance.

    Forgive me if any thing i posted is against to the rules if the forum.

    plzz help me if possible as early as possible.

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,540
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 284 Times in 279 Posts

    Default Re: how to use Multiple timers?

    Quote Originally Posted by mahi6a1985 View Post
    Hi Lesiok,

    I had done what you explained. But it was delaying the process.
    means 6 Qtimers created and connected to 6 diff slots with different timeouts.

    but i am the timers are getting delayed. As per my application i need to run all the timers at a time.

    sample code of mine is --



    1st & 2nd timers are the main timers i should not wanted them to be delayed, they should run at a time.

    Thanks in Advance.

    Forgive me if any thing i posted is against to the rules if the forum.

    plzz help me if possible as early as possible.
    Are you sure you read the documentation? I think not. Quote from the QTimer documentation :
    Timers will never time out earlier than the specified timeout value and they are not guaranteed to time out at the exact value specified. In many situations, they may time out late by a period of time that depends on the accuracy of the system timers.
    .....
    If Qt is unable to deliver the requested number of timer clicks, it will silently discard some.

Similar Threads

  1. Multiple timers in single Application
    By Qt Coder in forum Qt Programming
    Replies: 47
    Last Post: 5th October 2012, 13:23
  2. Multiple UI files
    By Diblye in forum Newbie
    Replies: 5
    Last Post: 29th June 2012, 00:24
  3. Multiple completion
    By gruszczy in forum Qt Programming
    Replies: 1
    Last Post: 3rd March 2009, 22:40
  4. Replies: 0
    Last Post: 21st December 2006, 11:48
  5. How to cleanup timers properly?
    By jpn in forum Qt Programming
    Replies: 7
    Last Post: 6th July 2006, 17:52

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
  •  
Qt is a trademark of The Qt Company.