Results 1 to 3 of 3

Thread: In layman's terms, what are signals and slots?

  1. #1
    Join Date
    Jul 2012
    Posts
    201
    Thanks
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default In layman's terms, what are signals and slots?

    Hi everyone, i'm new to OOP and Qt programming. can anyone define what signals and slots are in true layman's terms. I've red the definition in a book but i'm failing to grasp the concept of what they are and what purpose to they serve.

  2. #2
    Join Date
    Aug 2012
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: In layman's terms, what are signals and slots?

    A signal is the action required by the user and the slot if the action performed by the program.

    For example a signal would be clicking a button. The resulting slot could be to close the application.

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: In layman's terms, what are signals and slots?

    A signal is emitted by an object to indicate that some event has occurred. For example a signal might indicate that the text in a text box has been edited, or that a new piece of data has arrived over the network. A signal can be connected zero, one or more objects that are interested to know about these events. The function in the receiving object is a slot and can do whatever it like in response to the signal, for example copy the edited text somewhere or process the received data. The object issuing the signals does not need to know anything about the objects receiving the signal: the objects are considered loosely coupled.

    Signals and slots are the Qt answer to the Observer Pattern.

Similar Threads

  1. Scheduling long terms events in Qt
    By KanadaKid in forum Qt Programming
    Replies: 2
    Last Post: 12th October 2010, 05:49
  2. Signals and slots
    By sylvarant in forum Newbie
    Replies: 4
    Last Post: 11th September 2007, 15:48
  3. Signals and Slots
    By merry in forum Qt Programming
    Replies: 4
    Last Post: 22nd February 2007, 08:11
  4. help with signals and slots
    By superutsav in forum Qt Programming
    Replies: 3
    Last Post: 4th May 2006, 12:49
  5. Signals and Slots in dll
    By ankurjain in forum Qt Programming
    Replies: 8
    Last Post: 29th March 2006, 08:12

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.