Results 1 to 3 of 3

Thread: Any examples of receiving slots in threads?

  1. #1
    Join Date
    Aug 2008
    Posts
    14
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Any examples of receiving slots in threads?

    Does anyone know of any complete examples of threads receiving slots? I've read the various posts about it in this forum (which have been extremely helpful), but even after applying these techniques, it's just not working. I'm using a proxy object, created by the thread object, and can actually receive a "start" signal from the main thread, but later, during the thread's execution, signals sent from the main thread do not get through. An example of how it's supposed to be done would be very helpful.

    Thanks in advance.
    draftpunk

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Any examples of receiving slots in threads?

    It's not really any different from any other object. Thats how it was designed. If the signals are not getting through then the event loop is not being run. Ensure there are no blocking actions in the thread that can block the event queue. For example, long computations & Sleep.

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

    draftpunk (9th January 2010)

  4. #3
    Join Date
    Aug 2008
    Posts
    14
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Any examples of receiving slots in threads?

    Thanks. I had called exec() in the thread, but I was in the middle of a long processing function. Your response made me realize that my processing function was starving the event loop. Looks like I have some restructuring to do. Thanks again.

    draftpunk

Similar Threads

  1. threads, signals and slots
    By cyclic in forum Qt Programming
    Replies: 6
    Last Post: 2nd September 2009, 09:44
  2. Signals and Slots Across Threads
    By themusicalguy in forum Qt Programming
    Replies: 1
    Last Post: 26th October 2007, 11:16
  3. signals/slots across threads
    By high_flyer in forum Qt Programming
    Replies: 9
    Last Post: 12th March 2007, 23:56
  4. signal/slots across threads in Qt4
    By Ambiorix in forum Qt Programming
    Replies: 7
    Last Post: 31st July 2006, 08:05
  5. [QT4] threads, signals, and slots, please help.
    By ucntcme in forum Qt Programming
    Replies: 12
    Last Post: 25th January 2006, 14:23

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.