Results 1 to 3 of 3

Thread: Use QRunnable without QThreadPool

  1. #1
    Join Date
    Apr 2011
    Posts
    195
    Thanks
    49
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Use QRunnable without QThreadPool

    Hi
    Is it useful to use a QRunnable without a QThreadPool. I saw a program where the a QRunnable is instanitated and then the method run is called.
    What's the advantage for this, because I didn't see a QThreadPool.

    Runs the run method in it's own thread?

    thank u
    Last edited by Qiieha; 18th August 2011 at 09:32.

  2. #2
    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: Use QRunnable without QThreadPool

    There is no advantage. It's just like called an ordinary method of an ordinary class. No threading is involved.
    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.


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

    Qiieha (18th August 2011)

  4. #3
    Join Date
    Apr 2011
    Posts
    195
    Thanks
    49
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Use QRunnable without QThreadPool

    ok thank u for your reply.
    another little question = ):

    If I instantiate a QEventLoop in a class and call exec(), nothing happens until a connected slot calls loop.quit();
    After the quit call, the methods after the exec-call are processed? is this correct?

    Qt Code:
    1. loop.exec();
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Communication between QRunnable and main thread
    By Windsoarer in forum Qt Programming
    Replies: 4
    Last Post: 28th December 2010, 08:52
  2. How to emit signals from QRunnable?
    By mlheese in forum Newbie
    Replies: 1
    Last Post: 29th July 2010, 23:26
  3. QEventLoop and QThreadPool Shutdown Problems
    By shawno in forum Qt Programming
    Replies: 1
    Last Post: 23rd June 2010, 18:49
  4. QRunnable - how to cancel execution?
    By TorAn in forum Qt Programming
    Replies: 1
    Last Post: 3rd March 2010, 19:11
  5. QThreadPool and QRunnable
    By jimc1200 in forum Qt Programming
    Replies: 3
    Last Post: 6th May 2009, 10:43

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.