Results 1 to 8 of 8

Thread: Monitoring a variable or an object changed asynchronously by a Callback function

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: Monitoring a variable or an object changed asynchronously by a Callback function

    While I'm sure it's true that a queued connection (Qt::QueuedConnection) is slower, Qt also provides a direct connection (Qt::DirectConnection) which is a function call. The default is Qt::AutoConnection, in which Qt will use the appropriate direct or queued connection.

    When the signal is emitted from a different thread than the receiving slot, a queued connection must be used. I believe all other cases, a direct connection will be used for the same thread, unless you override the parameter on the connect statement and specify a Qt::QueuedConnection.
    Last edited by jefftee; 1st April 2015 at 22:12.

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

    sirop (2nd April 2015)

Similar Threads

  1. Need concurrency advice with callback function
    By BreakBad in forum Qt Programming
    Replies: 3
    Last Post: 29th January 2013, 20:20
  2. using function pointers and callback functions
    By ehnuh in forum General Programming
    Replies: 2
    Last Post: 5th November 2012, 11:00
  3. Qt classes in a callback function
    By Luc4 in forum Qt Programming
    Replies: 1
    Last Post: 13th May 2010, 13:47
  4. Interoperability of C Callback function and Qt
    By Vogel Ubrhar in forum Qt Programming
    Replies: 2
    Last Post: 17th March 2010, 16:02
  5. how to define the callback function in QThread?
    By cxl2253 in forum Qt Programming
    Replies: 6
    Last Post: 30th March 2007, 10:59

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
  •  
Qt is a trademark of The Qt Company.