Results 1 to 9 of 9

Thread: need advice on gui thread

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: which is the correct implementation for worker threas

    Quote Originally Posted by dpn View Post
    I have goggled for qt worker threads. I am new to Qt. I found three kinds of implementations.

    1. Inherit worker class from QThread and override Run()
    2. Create QThread object as member variable of worker class
    3. make it as a thread by using movetothread.
    You have two options here: 1 and 3. 2 alone does not make the worker code execute in the second thread.

    Quote Originally Posted by dpn View Post
    In which scenario, I have to use 1st approach. If possible, plz explain about other approaches.
    The 1st approach is useful if the parallized operation does not need an event loop, e.g. some form of blocking loop.
    The other approach is useful if you need an event loop.

    Cheers,
    _

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

    dpn (16th September 2013)

Similar Threads

  1. Replies: 1
    Last Post: 25th October 2012, 15:10
  2. Replies: 1
    Last Post: 28th March 2012, 18:58
  3. Replies: 9
    Last Post: 28th November 2009, 20:31
  4. Thread design advice needed
    By jonks in forum Qt Programming
    Replies: 3
    Last Post: 22nd October 2009, 21:32
  5. Advice needed regarding GUI and external thread cooperation
    By high_flyer in forum Qt Programming
    Replies: 3
    Last Post: 17th June 2009, 00:10

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.