Qt 4.8
|
The QFocusEvent class contains event parameters for widget focus events. More...
#include <qevent.h>
Public Functions | |
bool | gotFocus () const |
Returns true if type() is QEvent::FocusIn; otherwise returns false. More... | |
bool | lostFocus () const |
Returns true if type() is QEvent::FocusOut; otherwise returns false. More... | |
QFocusEvent (Type type, Qt::FocusReason reason=Qt::OtherFocusReason) | |
Constructs a focus event object. More... | |
Qt::FocusReason | reason () |
Qt::FocusReason | reason () const |
Returns the reason for this focus event. More... | |
~QFocusEvent () | |
Public Functions inherited from QEvent | |
void | accept () |
Sets the accept flag of the event object, the equivalent of calling setAccepted(true). More... | |
void | ignore () |
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false). More... | |
bool | isAccepted () const |
QEvent (Type type) | |
Contructs an event object of type type. More... | |
void | setAccepted (bool accepted) |
bool | spontaneous () const |
Returns true if the event originated outside the application (a system event); otherwise returns false. More... | |
Type | type () const |
Returns the event type. More... | |
virtual | ~QEvent () |
Destroys the event. More... | |
Properties | |
Qt::FocusReason | m_reason |
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(), QWidget::focusOutEvent(), QGraphicsItem::focusInEvent and QGraphicsItem::focusOutEvent() receive focus events.
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 1182 of file qevent.cpp.
QFocusEvent::~QFocusEvent | ( | ) |
Definition at line 1189 of file qevent.cpp.
|
inline |
Returns true if type() is QEvent::FocusIn; otherwise returns false.
Definition at line 281 of file qevent.h.
Referenced by QTextControlPrivate::focusEvent().
|
inline |
Returns true if type() is QEvent::FocusOut; otherwise returns false.
Definition at line 282 of file qevent.h.
Qt::FocusReason QFocusEvent::reason | ( | ) |
Definition at line 1197 of file qevent.cpp.
Referenced by QX11EmbedContainer::eventFilter(), QTextControlPrivate::focusEvent(), QGroupBox::focusInEvent(), QPushButton::focusInEvent(), QGraphicsProxyWidget::focusInEvent(), QMdiSubWindow::focusInEvent(), QAbstractSpinBox::focusInEvent(), QDateTimeEdit::focusInEvent(), QLineEdit::focusInEvent(), QPlainTextEdit::focusInEvent(), QGraphicsScene::focusInEvent(), QTextEdit::focusInEvent(), QGraphicsTextItem::focusInEvent(), QPushButton::focusOutEvent(), QGraphicsProxyWidget::focusOutEvent(), QAxHostWidget::focusOutEvent(), QAbstractButton::focusOutEvent(), QLabel::focusOutEvent(), QLineEdit::focusOutEvent(), and QGraphicsScene::focusOutEvent().
Qt::FocusReason QFocusEvent::reason | ( | ) | const |
|
private |