Results 1 to 6 of 6

Thread: GUI Updates from separate Thread

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,540
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: GUI Updates from separate Thread

    1. You ARE blocking GUI thread beacuse second thread is created in slot on_btnRun_clicked() and You are waiting in this slot for finishing this thread.
    2. In worker thread You are NOT starting event loop. So signals from worker thread are NOT provided to main thread.

  2. #2
    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: GUI Updates from separate Thread

    Quote Originally Posted by Lesiok View Post
    2. In worker thread You are NOT starting event loop. So signals from worker thread are NOT provided to main thread.
    This is actually false. Signals don't need an event loop, only slots do.
    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. #3
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,540
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: GUI Updates from separate Thread

    Quote Originally Posted by wysota View Post
    This is actually false. Signals don't need an event loop, only slots do.
    My mistake. Thank you for correcting Wysota.

  4. #4
    Join Date
    Jun 2012
    Posts
    13
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: GUI Updates from separate Thread

    Auggh, that should have been obvious to me now that you point it out. Made the necessary changes and it now works like a charm. Thanks.

Similar Threads

  1. Replies: 5
    Last Post: 17th July 2011, 05:27
  2. Thread updates progress bar
    By GianMarco in forum Qt Programming
    Replies: 7
    Last Post: 12th October 2009, 13:29
  3. update widget from separate thread
    By method in forum Qt Programming
    Replies: 5
    Last Post: 10th July 2009, 14:33
  4. new QWidget in separate thread
    By magland in forum Qt Programming
    Replies: 15
    Last Post: 7th February 2008, 12:32
  5. handling paintGL in a separate thread
    By al101 in forum Qt Programming
    Replies: 1
    Last Post: 15th May 2007, 17:04

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.