Results 1 to 5 of 5

Thread: understanding threads / serial communication with thread

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2010
    Location
    Germany / South Africa
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    1

    Default Re: understanding threads / serial communication with thread

    Quote Originally Posted by toutarrive View Post
    QThread:run() : Returning from this method will end the execution of the thread
    Hi, Thanks for your answer.

    A Returing (meaning 'return 0;' eg.) seems to be complicated under most circumstances.
    Just to make sure, that I am right: when I call the run-function, the thread starts to work and with the exec(); it stays running? So what about quit() or exit()?

  2. #2
    Join Date
    Mar 2008
    Location
    France
    Posts
    149
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    2
    Thanked 21 Times in 21 Posts

    Default Re: understanding threads / serial communication with thread

    Create an instance of the thread object and call QThread::start().
    The code that appears in you run() reimplementation will then be executed in a separate thread.
    There is no need to call the run function directly

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

    brott (7th March 2010)

Similar Threads

  1. serial communication
    By klitsuk in forum Qt Programming
    Replies: 10
    Last Post: 24th September 2009, 02:21
  2. serial communication
    By klitsuk in forum Qt Programming
    Replies: 1
    Last Post: 10th March 2009, 16:22
  3. serial communication
    By semden in forum Qt Programming
    Replies: 2
    Last Post: 13th February 2009, 10:57
  4. C++ Library for serial communication
    By dec0ding in forum General Programming
    Replies: 7
    Last Post: 8th July 2007, 19:18
  5. serial port and USB communication
    By shamik in forum Qt Programming
    Replies: 5
    Last Post: 4th December 2006, 11: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
  •  
Qt is a trademark of The Qt Company.