Results 1 to 3 of 3

Thread: QTimer in QThread - Seem to be always 5 seconds

  1. #1
    Join Date
    Jul 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QTimer in QThread - Seem to be always 5 seconds

    I have a QTimer in a QThread that should fire every 50ms (I pass 50 to
    I am developing an application with Qt 4.6.3 under Linux using threads and timers.

    If I create a QTimer and start it with a 50ms timeout it actually fires every 5000ms. If I change 50 to 100 I still get a timeout interval of 5000ms.

    I have tried startTimer and timerEvent and QBasicTimer but get the same problem.

    It appears to have something to do with the event loop.

    Any suggestions as to what is happening?

  2. #2
    Join Date
    May 2010
    Location
    slovakia
    Posts
    47
    Thanks
    10
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Maemo/MeeGo

    Default Re: QTimer in QThread - Seem to be always 5 seconds

    can you post code?

  3. #3
    Join Date
    Jul 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTimer in QThread - Seem to be always 5 seconds

    I have since resolved the problem. I was using QextSerialPort, as written there is an implicit timeout wait, hence the block.
    Thanks for the assistance.

Similar Threads

  1. how to change msleep seconds in QThread
    By sdastagirmca in forum Qt Programming
    Replies: 2
    Last Post: 21st July 2010, 12:27
  2. qthread / qtimer
    By Galen in forum Qt Programming
    Replies: 5
    Last Post: 17th April 2010, 22:57
  3. QThread and QTimer
    By sivrisinek in forum Qt Programming
    Replies: 4
    Last Post: 30th April 2009, 16:41
  4. QThread & QTimer
    By hosseinyounesi in forum Qt Programming
    Replies: 5
    Last Post: 13th April 2009, 08:22
  5. QTimer and QThread
    By TheKedge in forum Qt Programming
    Replies: 4
    Last Post: 21st September 2006, 14:52

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.