= Event handler
An <event handler> is code invoked to respond to a particular <software event>, such as a key press, resize or completed operation. The event's data identifies what happened; the <event handler> interprets it using the application's current <state>. Qt dispatches an event object to its target and then to an appropriate event-specific method.<The Event System in the Qt 6 documentation>[How Events are Delivered and Event Handlers]{ref}
For example, a resize <event handler> can recompute a plot's displayed layout from the new dimensions. A later paint <software event> draws that layout. Keeping each response short lets an <event loop> handle other work promptly. When delivery is delayed, the application's <state> may already have changed, so the original occurrence and its eventual handling must be distinguished.
Back to article page