What Is a Slot?

A slot is a small opening, depression, groove, notch, or slit that serves a specific purpose. Examples include the interior slot in a copy desk occupied by the chief copy editor or the opening between the primaries of certain birds that maintain a smooth flow of air over the wings.

In the aviation industry, slots are used to manage air traffic at busy airports and avoid repeated delays caused by multiple flights operating at the same time. They also allow airport operators to regulate their airspace by assigning slots for flight arrivals and departures during a specified time period.

Signal-to-Slot Mapping

The signal-to-slot mapping is a component programming feature that describes how signals are passed to slots. A signal can have zero, one, or more typed parameters and is associated with a slot function, which matches the signal type and returns void if it fails.

Slot Functions

A slot function accepts a pointer or a reference to an argument, and is called when the signal is emitted. It may be associated with several signals, and each signal is called in order of association.

Component Reusability

Scoped slots can be passed data and are useful for customizing templates or preparing external APIs. They can also be scoped to a child component to access its data.

Method Slots

Method slots are a type of object that can keep more than one function open at a time and are often used for game development. They are accessed by calling the slot_function method on a class.