Qt Signals & Slots: How they work
The one thing that confuses the most people in the beginning is the
Signal & Slot mechanism of Qt. But it’s actually not that difficult to
understand. In general Signals & Slots are used to loosely connect
classes. Illustrated by the keyword emit
, Signals are used to
broadcast a message to all connected Slots. If no Slots are connected,
the message “is lost in the wild”. So a connection between Signals &
Slots is like a TCP/IP connection with a few exceptions, but this
metaphor will help you to get the principle. A Signal is an outgoing
port and a Slot is an input only port and a Signal can be connected to
multiple Slots.