Results 1 to 3 of 3

Thread: QThread confusion, yet another question about quiting thread

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Solved

    Quote Originally Posted by Talei View Post
    I would like to know why when I use
    connect( th, SIGNAL(started()), this, SLOT(threadStarted()));
    the function in this SLOT is run but thread don't seams to react properly (is it because the SLOT is in the same Thread as the QThread, with is GUI thread?).
    Absolutely. connections can be autodetected, queued or direct. If they're directly connected, the slot is executed in the emitting thread, if they're queued the slot is executed in the thread its class lives in. In this case QThread did emit started(), but QThread lives in the main thread, just like your MainWindow. No reason to perform the threadStarted() function in a different thread there.
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

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

    Talei (29th July 2010)

Similar Threads

  1. How can I get the thread ID out of QThread
    By Artschi in forum Qt Programming
    Replies: 9
    Last Post: 8th November 2017, 03:27
  2. GUI thread blocked using QThread.
    By summer_of_69 in forum Qt Programming
    Replies: 11
    Last Post: 18th May 2009, 09:43
  3. [QThread] ptrace in thread
    By Macok in forum Qt Programming
    Replies: 4
    Last Post: 8th February 2009, 21:00
  4. Replies: 4
    Last Post: 26th June 2008, 18:41
  5. QThread, QMessageBox, gui thread
    By TheKedge in forum Qt Programming
    Replies: 1
    Last Post: 25th October 2006, 12:23

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.