Results 1 to 4 of 4

Thread: When should I use signal/slot mechanism

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #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: When should I use signal/slot mechanism

    I think of signal/slots as being able to reuse existing code more easily. It then doesn't depend on other classes (and doesn't care about them). Other classes can connect to it's signals and decide what methods they want to call as a result of those signals being raised.

    If your class containing the signal already has a relationship with another class, and that class is the only one interested in that signal, then I see no reason to actually use signals/slots in that case. Call the method directly. It'll be faster too.

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

    Bryku (10th February 2010)

Similar Threads

  1. slow signal-slot-mechanism
    By blm in forum Qt Programming
    Replies: 11
    Last Post: 28th October 2008, 17:10
  2. pointers behaviour in qt and specially signals/slot mechanism
    By salmanmanekia in forum Qt Programming
    Replies: 5
    Last Post: 17th August 2008, 19:34
  3. can a single statement work in signal/slot mechanism
    By salmanmanekia in forum Qt Programming
    Replies: 1
    Last Post: 8th August 2008, 08:24
  4. The threaded signal/slot mechanism
    By xbtl in forum Newbie
    Replies: 1
    Last Post: 30th March 2008, 00:07
  5. Replies: 4
    Last Post: 23rd January 2006, 16:51

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.