QFocusEvent Class Reference

#include <qevent.h>

Inheritance diagram for QFocusEvent:

Inheritance graph
[legend]
Collaboration diagram for QFocusEvent:

Collaboration graph
[legend]
List of all 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, 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.

See also:
QWidget::setFocus(), QWidget::setFocusPolicy(), {Keyboard Focus}

Definition at line 238 of file qevent.h.

Public Member Functions

 QFocusEvent (Type type, Qt::FocusReason reason=Qt::OtherFocusReason)
 ~QFocusEvent ()
bool gotFocus () const
bool lostFocus () const
Qt::FocusReason reason ()
Qt::FocusReason reason () const

Private Attributes

Qt::FocusReason m_reason


Constructor & Destructor Documentation

QFocusEvent::QFocusEvent ( Type  type,
Qt::FocusReason  reason = Qt::OtherFocusReason 
)

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 916 of file qevent.cpp.

00917     : QEvent(type), m_reason(reason)
00918 {}

QFocusEvent::~QFocusEvent (  ) 

Definition at line 923 of file qevent.cpp.

00924 {
00925 }


Member Function Documentation

bool QFocusEvent::gotFocus (  )  const [inline]

Returns true if type() is QEVent::FocusIn; otherwise returns false.

Definition at line 244 of file qevent.h.

References QEvent::type().

Referenced by QTextControlPrivate::focusEvent().

00244 { return type() == FocusIn; }

Here is the call graph for this function:

bool QFocusEvent::lostFocus (  )  const [inline]

Returns true if type() is QEVent::FocusOut; otherwise returns false.

Definition at line 245 of file qevent.h.

References QEvent::type().

00245 { return type() == FocusOut; }

Here is the call graph for this function:

Qt::FocusReason QFocusEvent::reason (  ) 

Definition at line 931 of file qevent.cpp.

References m_reason.

Referenced by QX11EmbedContainer::eventFilter(), QTextControlPrivate::focusEvent(), QGroupBox::focusInEvent(), Q3IconView::focusInEvent(), QGraphicsScene::focusInEvent(), Q3ListView::focusInEvent(), Q3ListBox::focusInEvent(), QPushButton::focusInEvent(), QLineEdit::focusInEvent(), Q3IconView::focusOutEvent(), Q3ListView::focusOutEvent(), QGraphicsScene::focusOutEvent(), QLineEdit::focusOutEvent(), Q3IconViewItemLineEdit::focusOutEvent(), Q3ListBox::focusOutEvent(), QPushButton::focusOutEvent(), Q3Table::focusOutEvent(), and QAbstractButton::focusOutEvent().

00932 {
00933     return m_reason;
00934 }

Qt::FocusReason QFocusEvent::reason (  )  const

Returns the reason for this focus event.

Definition at line 939 of file qevent.cpp.

References m_reason.

00940 {
00941     return m_reason;
00942 }


Member Data Documentation

Qt::FocusReason QFocusEvent::m_reason [private]

Definition at line 257 of file qevent.h.

Referenced by reason().


The documentation for this class was generated from the following files:
Generated on Thu Mar 15 17:35:02 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1