Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions | ![]() |
The QFocusEvent class contains event parameters for widget focus events. More...
#include <QFocusEvent>
Inherits QEvent.
The QFocusEvent class contains event parameters for widget focus events.
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 QWidget::focusInEvent() and QWidget::focusOutEvent() receive focus events.
Use setReason() to set the reason for all focus events, and resetReason() to reset the reason for all focus events to the previously defined reason before the last setReason() call.
See also QWidget::setFocus() and QWidget::setFocusPolicy().
This enum specifies why the focus changed.
QFocusEvent::Mouse | A mouse action occurred. |
QFocusEvent::Tab | The Tab key was pressed. |
QFocusEvent::Backtab | A Backtab occurred. The input for this may include the Shift or Control keys; e.g. Shift+Tab. |
QFocusEvent::ActiveWindow | The window system made this window either active or inactive. |
QFocusEvent::Popup | The application opened/closed a popup that grabbed/released the keyboard focus. |
QFocusEvent::Shortcut | A keyboard shortcut was input. |
QFocusEvent::Other | Another reason, usually application-specific. |
See the keyboard focus overview for more about the keyboard focus.
Constructs a focus event object.
The type parameter must be either QEvent::FocusIn or QEvent::FocusOut.
Returns true if the widget received the text input focus; otherwise returns false.
Returns true if the widget lost the text input focus; otherwise returns false.
Returns the reason for this focus event.
See also setReason().
Resets the reason for all future focus events to the value before the last setReason() call.
See also reason() and setReason().
Sets the reason for all future focus events to reason.
See also reason() and resetReason().
Copyright © 2004 Trolltech. | Trademarks | Qt 4.0.0-tp1 |