# 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

- QFocusEvent ( int type )
- bool gotFocus () const
- bool lostFocus () const

## Detailed Description

The QFocusEvent class contains event parameters for widget focus events.

Focus events are sent to widgets when the keyboard input focus changes.

The event handlers QWidget::focusInEvent() and QWidget::focusOutEvent() receive focus events.

See also: QWidget::setFocus() and QWidget::setFocusEnabled().

Examples: table/table.cpp qmag/qmag.cpp

## Member Function Documentation

### QFocusEvent::QFocusEvent ( int type )

Constructs a focus event object.

The type parameter must be either Event_FocusIn or Event_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.

Search the documentation, FAQ, qt-interest archive and more (uses www.troll.no):

This file is part of the Qt toolkit, copyright © 1995-99 Troll Tech, all rights reserved.

It was generated from the following files:

- qevent.h: 1998/10/05
- qdnd_x11.cpp: 1998/12/17
- qevent.cpp: 1999/01/13