QFocusEvent

The QFocusEvent class contains event parameters for widget focus events. More

Inheritance diagram of PySide2.QtGui.QFocusEvent

Synopsis

Functions

Detailed Description

Focus events are sent to widgets when the keyboard input focus changes. Focus events occur due to mouse actions, key presses (such as 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.

The event handlers focusInEvent() , focusOutEvent() , focusInEvent and focusOutEvent() receive focus events.

See also

setFocus() setFocusPolicy() Keyboard Focus in Widgets

class PySide2.QtGui.QFocusEvent(type[, reason=Qt.OtherFocusReason])
param type:

Type

param reason:

FocusReason

Constructs a focus event object.

The type parameter must be either FocusIn or FocusOut . The reason describes the cause of the change in focus.

PySide2.QtGui.QFocusEvent.gotFocus()
Return type:

bool

Returns true if type() is FocusIn ; otherwise returns false.

PySide2.QtGui.QFocusEvent.lostFocus()
Return type:

bool

Returns true if type() is FocusOut ; otherwise returns false.

PySide2.QtGui.QFocusEvent.reason()
Return type:

FocusReason

Returns the reason for this focus event.