A signal is a special property of an object that can be emitted in response to a type of event. An event may be something such as a user action, a timeout, or the completion of an asynchronous method call.
Slots are object methods that can receive a signal and act in response to it. We connect signals to slots in order to configure our application's response to an event.
All classes descended from QObject (which accounts for most classes in Qt, including all QWidget classes) can send and receive signals. Each different class has its own set of signals and slots appropriate for the function of that class.
For example, QPushButton has a clicked signal that is emitted whenever the button is clicked by a user. The QWidget class has a close() slot that causes it to close if it's a top-level window. We could connect the two like this:
self.quitbutton...