QFocusEvent¶
The
QFocusEvent
class contains event parameters for widget focus events. More…
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
andfocusOutEvent()
receive focus events.See also
setFocus()
setFocusPolicy()
Keyboard Focus in Widgets
- class PySide2.QtGui.QFocusEvent(type[, reason=Qt.OtherFocusReason])¶
- param type:
- param reason:
Constructs a focus event object.
The
type
parameter must be eitherFocusIn
orFocusOut
. Thereason
describes the cause of the change in focus.
- PySide2.QtGui.QFocusEvent.gotFocus()¶
- Return type:
bool
Returns
true
iftype()
isFocusIn
; otherwise returns false.
- PySide2.QtGui.QFocusEvent.lostFocus()¶
- Return type:
bool
Returns
true
iftype()
isFocusOut
; otherwise returns false.
- PySide2.QtGui.QFocusEvent.reason()¶
- Return type:
Returns the reason for this focus event.
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.