QFocusEvent Class Reference
The QFocusEvent class contains event parameters for widget focus
events.
More...
#include <qevent.h>
Inherits QEvent.
List of all member functions.
Public Members
enum
Reason { Mouse, Tab, Backtab, ActiveWindow, Popup, Shortcut, Other }
Static Public Members
Detailed Description
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, keypresses (e.g. 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 set the reason for all focus events to the reason in
force before the last setReason() call.
See also QWidget::setFocus() and QWidget::focusPolicy.
Member Type Documentation
QFocusEvent::Reason
- QFocusEvent::Mouse - The focus change happened because of a mouse action.
- QFocusEvent::Tab - The focus change happened because of a Tab press
- QFocusEvent::Backtab - The focus change happened because of a Backtab press
(possibly including Shift/Control, e.g. Shift+Tab).
- QFocusEvent::ActiveWindow - The window system made this window (in)active.
- QFocusEvent::Popup - The application opened/closed a popup that grabbed/released focus.
- QFocusEvent::Shortcut - The focus change happened because of a keyboard shortcut.
- QFocusEvent::Other - Any other reason, usually application-specific.
See the keyboard focus overview for more about focus.
Member Function Documentation
QFocusEvent::QFocusEvent ( Type type )
Constructs a focus event object.
The type parameter must be either QEvent::FocusIn or QEvent::FocusOut.
bool QFocusEvent::gotFocus () const
Returns TRUE if the widget received the text input focus.
bool QFocusEvent::lostFocus () const
Returns TRUE if the widget lost the text input focus.
Reason QFocusEvent::reason () [static]
Returns the reason for this focus event.
See also setReason().
void QFocusEvent::resetReason () [static]
Resets the reason for all future focus events to the value before
the last setReason() call.
See also reason() and setReason().
void QFocusEvent::setReason ( Reason reason ) [static]
Sets the reason for all future focus events to reason.
See also reason() and resetReason().
Search the documentation, FAQ, qt-interest archive and more (uses
www.trolltech.com):
This file is part of the Qt toolkit,
copyright © 1995-2001
Trolltech, all rights reserved.
Copyright © 2001 Trolltech | Trademarks
| Qt version 3.0.0-beta1-beta1
|