Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
The QFocusEvent class contains event parameters for widget focus events. More...
#include <qevent.h>
Public Member Functions | |
QFocusEvent (Type type, Qt::FocusReason reason=Qt::OtherFocusReason) | |
Constructs a focus event object. | |
bool | gotFocus () const |
Returns true if type() is QEvent::FocusIn; otherwise returns false. | |
bool | lostFocus () const |
Returns true if type() is QEvent::FocusOut; otherwise returns false. | |
Qt::FocusReason | reason () const |
Returns the reason for this focus event. | |
Public Member Functions inherited from QEvent | |
QEvent (Type type) | |
Constructs an event object of type type. | |
virtual | ~QEvent () |
Destroys the event. | |
Type | type () const |
Returns the event type. | |
bool | spontaneous () const |
Returns true if the event originated outside the application (a system event); otherwise returns false . | |
virtual void | setAccepted (bool accepted) |
bool | isAccepted () const |
void | accept () |
Sets the accept flag of the event object, the equivalent of calling setAccepted(true). | |
void | ignore () |
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false). | |
bool | isInputEvent () const noexcept |
bool | isPointerEvent () const noexcept |
bool | isSinglePointEvent () const noexcept |
virtual QEvent * | clone () const |
Creates and returns an identical copy of this event. | |
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 1560 of file qevent.cpp.
|
inline |
Returns true
if type() is QEvent::FocusIn; otherwise returns false.
|
inline |
Returns true
if type() is QEvent::FocusOut; otherwise returns false.
Qt::FocusReason QFocusEvent::reason | ( | ) | const |
Returns the reason for this focus event.
Definition at line 1569 of file qevent.cpp.