Results 1 to 5 of 5

Thread: Does QCoreApplication::processEvents call posted events processing ?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Does QCoreApplication::processEvents call posted events processing ?

    Quote Originally Posted by burkav84 View Post
    So, if I post event from the non-gui thread by QCoreApplication:: postEvent or emit signal from QThread:: run, connnected as Qt:: QueuedConnection it will not process while gui thread won't return to the QApplication event loop or will be processed if I make it force by QCoreApplication:: sendPostedEvents. If I call QCoreApplication:: processEvents(...) it will NOT cause posted events processing, only paint events, timer and so on ?
    It doesn't matter where the event is posted (or a queued signal is emitted) from. What does matter is where the receiver object lives.

    If the receiver lives in the main thread (*), the event gets added to the event queue of the main thread. QCoreApplication::processEvents() is there for processing pending events from the main thread's event queue and is not safe to be called from another thread than the main thread.

    (*) with "main thread" I mean the same thread where the application object lives
    J-P Nurmi

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

    burkav84 (21st February 2007)

Similar Threads

  1. Grab keyboard events in Windows
    By durbrak in forum Qt Programming
    Replies: 1
    Last Post: 4th February 2007, 19:56
  2. Qtoolbutton-ignoring mouse events
    By rvenugopal in forum Qt Programming
    Replies: 2
    Last Post: 26th December 2006, 22:12
  3. why cant i call setGeometry
    By freegnu in forum Qt Programming
    Replies: 1
    Last Post: 14th June 2006, 04:59
  4. QStackerWidget and mouse events
    By high_flyer in forum Qt Programming
    Replies: 3
    Last Post: 25th April 2006, 19:25
  5. Delays in processing events
    By Caius Aérobus in forum Qt Programming
    Replies: 6
    Last Post: 7th April 2006, 12:42

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.