Results 1 to 20 of 48

Thread: Multiple timers in single Application

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #14
    Join Date
    Jun 2010
    Location
    Pretoria, South Africa
    Posts
    22
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Multiple timers in single Application

    @mahi6a1985

    Do you really need 6 QTimers? I see from your code that there are two QTimers linked to the footer() slot.

    I would seriously consider moving your processing to different threads.

    When a QTimer emits the timeout signal, it gets put in the message queue and the slot is called by the event posting mechanism. Since all your QTimers are in the same thread, their timeout signals all get processed one after another.

    If, by chance, all the QTimers timeout at exactly the same time, then, the footer() slot will be called at least 925ms after update_HMIScrLvl4(). That's assuming that each of the slots instantaneously returned and called the subsequent timeout slot.

    I would suggest that you put each of your timer slots into its own thread, or group the processing by timeout interval. By this I mean that, because failure_display() and footer() are triggered every 250ms, their code could be executed in the same thread, if you like.

  2. The following user says thank you to Robbie for this useful post:

    mahi6a1985 (22nd September 2012)

Similar Threads

  1. Single Application Instance
    By BadKnees in forum Qt Programming
    Replies: 8
    Last Post: 4th November 2014, 14:57
  2. Multiple project files in a single directory
    By jogeshwarakundi in forum Qt for Embedded and Mobile
    Replies: 5
    Last Post: 17th July 2008, 07:03
  3. Single QGLContext across multiple QGLWidgets
    By pseudosig in forum Qt Programming
    Replies: 2
    Last Post: 22nd June 2008, 23:13
  4. Single slot for multiple list boxes
    By Sheetal in forum Qt Programming
    Replies: 1
    Last Post: 15th April 2008, 06:53
  5. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13

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.