Results 1 to 5 of 5

Thread: When should i use QThread and QTimer

  1. #1
    Join Date
    Mar 2012
    Location
    Chennai/India
    Posts
    8
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default When should i use QThread and QTimer

    Can anyone please tell me,when shoud i use choose QTimer or QThread in my qt application with small example scenario.
    Thankyou.
    Qt Developer !!!!!!!!!!!

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: When should i use QThread and QTimer

    QThread: Rarely. Very little in the average application requires threads in Qt.
    QTimer: Quite often. Useful for repeating tasks or delayed execution of single tasks.

    The two are not related.

  3. #3
    Join Date
    Mar 2012
    Location
    Chennai/India
    Posts
    8
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: When should i use QThread and QTimer

    Thankyou
    But in my application i have to read data from piece of hardware and plotting this into qwtplot widget,so if i choose QTimer for updating plot it is very slow compared to QThread.
    Qt Developer !!!!!!!!!!!

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

    Default Re: When should i use QThread and QTimer

    Quote Originally Posted by NathiyaAmose View Post
    Thankyou
    But in my application i have to read data from piece of hardware and plotting this into qwtplot widget,so if i choose QTimer for updating plot it is very slow compared to QThread.
    It's not about choosing the right technique that matters, it is about proper usage of the one you choose.
    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.


  5. #5
    Join Date
    Mar 2012
    Location
    Chennai/India
    Posts
    8
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: When should i use QThread and QTimer

    Yes you are right.
    Thankyou
    Qt Developer !!!!!!!!!!!

Similar Threads

  1. Replies: 15
    Last Post: 4th August 2012, 19:11
  2. Using QTimer in a QThread
    By Cruz in forum Qt Programming
    Replies: 38
    Last Post: 25th April 2011, 11:29
  3. QTimer within QThread
    By Eos Pengwern in forum Qt Programming
    Replies: 6
    Last Post: 23rd February 2011, 20:00
  4. QThread and QTimer
    By sivrisinek in forum Qt Programming
    Replies: 4
    Last Post: 30th April 2009, 16:41
  5. QThread & QTimer
    By hosseinyounesi in forum Qt Programming
    Replies: 5
    Last Post: 13th April 2009, 08:22

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.