Results 1 to 12 of 12

Thread: QThread: Move owner of thread to thread with moveToThread

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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: QThread: Move owner of thread to thread with moveToThread

    Both the worker and the QThread issue a finished() signal when they are done. Connect to that signal and put your post-processing in the slot. Then you don't have to block the Qt event loop and GUI update.

  2. #2
    Join Date
    Dec 2011
    Posts
    11
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QThread: Move owner of thread to thread with moveToThread

    But I whould like to exit the entire program when the user presses Cancel. I would like to make sure the threads are finished before I exit the program.

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

    Default Re: QThread: Move owner of thread to thread with moveToThread

    Quote Originally Posted by SepticInsect View Post
    But I whould like to exit the entire program when the user presses Cancel. I would like to make sure the threads are finished before I exit the program.
    So when all threads are finished(), check if cancel was pressed, and if so, quit the application.
    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.


  4. The following user says thank you to wysota for this useful post:

    SepticInsect (12th September 2012)

  5. #4
    Join Date
    Dec 2011
    Posts
    11
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QThread: Move owner of thread to thread with moveToThread

    Thanks everyone for the help! The problem is solved!

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. Replies: 1
    Last Post: 4th September 2012, 14:13
  3. multithread thread don't move
    By lzpmail in forum Qt Programming
    Replies: 11
    Last Post: 28th March 2011, 09:09
  4. Replies: 5
    Last Post: 22nd February 2011, 21:21
  5. Finishing a thread in QThread
    By Tio in forum Newbie
    Replies: 9
    Last Post: 2nd June 2010, 17:38

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.