QtBase
v6.3.1
|
The QFocusEvent class contains event parameters for widget focus events. \inmodule QtGui. More...
#include <qevent.h>
Public Member Functions | |
QFocusEvent (Type type, Qt::FocusReason reason=Qt::OtherFocusReason) | |
~QFocusEvent () | |
QFocusEvent * | clone () const override |
bool | gotFocus () const |
bool | lostFocus () const |
Qt::FocusReason | reason () const |
Public Member Functions inherited from QEvent | |
QEvent (Type type) | |
virtual | ~QEvent () |
Type | type () const |
bool | spontaneous () const |
virtual void | setAccepted (bool accepted) |
bool | isAccepted () const |
void | accept () |
void | ignore () |
bool | isInputEvent () const noexcept |
bool | isPointerEvent () const noexcept |
bool | isSinglePointEvent () const noexcept |
The QFocusEvent class contains event parameters for widget focus events. \inmodule QtGui.
Focus events are sent to widgets when the keyboard input focus changes. Focus events occur due to mouse actions, key presses (such as \uicontrol{Tab} or \uicontrol{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 QWidget::focusInEvent(), QWidget::focusOutEvent(), QGraphicsItem::focusInEvent and QGraphicsItem::focusOutEvent() receive focus events.
|
explicit |
Constructs a focus event object.
The type parameter must be either QEvent::FocusIn or QEvent::FocusOut. The reason describes the cause of the change in focus.
Definition at line 1594 of file qevent.cpp.
QFocusEvent::~QFocusEvent | ( | ) |
Definition at line 1601 of file qevent.cpp.
|
inlineoverridevirtual |
|
inline |
Returns true
if type() is QEvent::FocusIn; otherwise returns false.
Definition at line 528 of file qevent.h.
|
inline |
Returns true
if type() is QEvent::FocusOut; otherwise returns false.
Definition at line 529 of file qevent.h.
Qt::FocusReason QFocusEvent::reason | ( | ) | const |
Returns the reason for this focus event.
Definition at line 1608 of file qevent.cpp.