Focus motion
The customs which have evolved for directing keyboard focus to a particular widget are these:
The user presses Tab (or Shift+Tab) (or sometimes Enter).
The user clicks a widget.
The user presses a keyboard shortcut.
The user uses the mouse wheel.
The user moves the focus to a window, and the application must determine which widget within the window should get the focus.
Each of these motion mechanisms is different, and different types of widgets receive focus in only some of them. We'll cover each of them in turn.
QWidget::FocusPolicy
This enum type defines the various policies a widget can have with respect to acquiring keyboard focus.
QWidget::TabFocus - the widget accepts focus by tabbing.
QWidget::ClickFocus - the widget accepts focus by clicking.
QWidget::StrongFocus - the widget accepts focus by both tabbing and clicking.
QWidget::WheelFocus - like StrongFocus plus the widget accepts focus by using the mouse wheel.
QWidget::NoFocus - the widget does not accept focus.