The QFocusEvent class contains event parameters for widget focus events.
.PP
Focus events are sent to widgets when the keyboard input focus changes. Focus events occur due to mouse actions, keypresses (e.g. Tab or Backtab), the window system, popup menus, keyboard shortcuts or other application specific reasons. The reason for a particular focus event is returned by reason() in the appropriate event handler.
.PP
The event handlers QWidget::focusInEvent() and QWidget::focusOutEvent() receive focus events.
.PP
Use setReason() to set the reason for all focus events, and resetReason() to set the reason for all focus events to the reason in force before the last setReason() call.
.PP
See also QWidget::setFocus(), QWidget::focusPolicy, and Event Classes.
.SS "Member Type Documentation"
.SH "QFocusEvent::Reason"
This enum specifies why the focus changed.
.TP
\fCQFocusEvent::Mouse\fR - because of a mouse action.
.TP
\fCQFocusEvent::Tab\fR - because of a Tab press.
.TP
\fCQFocusEvent::Backtab\fR - because of a Backtab press (possibly including Shift/Control, e.g. Shift+Tab).
.TP
\fCQFocusEvent::ActiveWindow\fR - because the window system made this window (in)active.
.TP
\fCQFocusEvent::Popup\fR - because the application opened/closed a popup that grabbed/released focus.
.TP
\fCQFocusEvent::Shortcut\fR - because of a keyboard shortcut.
.TP
\fCQFocusEvent::Other\fR - any other reason, usually application-specific.
.PP
See the keyboard focus overview for more about focus.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QFocusEvent::QFocusEvent ( Type type )"
Constructs a focus event object.
.PP
The \fItype\fR parameter must be either QEvent::FocusIn or QEvent::FocusOut.
.SH "bool QFocusEvent::gotFocus () const"
Returns TRUE if the widget received the text input focus; otherwise returns FALSE.
.SH "bool QFocusEvent::lostFocus () const"
Returns TRUE if the widget lost the text input focus; otherwise returns FALSE.