Results 1 to 3 of 3

Thread: Classic GUI and threading issue

  1. #1
    Join Date
    Nov 2007
    Posts
    24
    Thanks
    5
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Classic GUI and threading issue

    Hi,

    As I can read, to do the right thing with QT and GUI threading, we have to :
    1. Create a new thread (I already have my MainWindow)
    2. Compute inside this thread all the "heavy stuff"
    3. Then sending a signal to main gui thread (MainWindow) to do the all rendering/widget update.

    Right, but I still don't understand how, in this same main thread, things will not freeze If I do important graphics updates

    To give you an example :
    In the Mandelbrot Qt sample, in the rendering function (updatePixMap()), if I insert a very time consuming code, all the main window still frozen !?

    Is it possible to avoid this ?

    Thanks.

  2. #2
    Join Date
    May 2011
    Posts
    239
    Thanks
    4
    Thanked 35 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: Classic GUI and threading issue

    Yes: Don't insert a very time consuming code to the UI thread... Do it like in the example: create an image, doing time-consuming processing, as QImage in the worker thread and just splash that into place in the UI thread -- which is very fast.

  3. #3
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Classic GUI and threading issue

    I don't think we need to keep this one open...
    http://www.qtcentre.org/threads/5034...hreading-issue
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. Threading issue in DLL
    By CristonDK in forum Qt Programming
    Replies: 6
    Last Post: 15th June 2012, 18:07
  2. Replies: 1
    Last Post: 29th September 2011, 19:20
  3. Threading with rsh and rcp
    By jaxrpc in forum Newbie
    Replies: 2
    Last Post: 4th June 2010, 11:50
  4. Threading Issue
    By noufalk in forum Qt Programming
    Replies: 4
    Last Post: 4th August 2007, 13:45
  5. Sub-Threading
    By TheGrimace in forum Qt Programming
    Replies: 4
    Last Post: 7th June 2007, 16:38

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.