Classes - Annotated - Tree - Functions - Home - Structure Qte

QEvent Class Reference

The QEvent class is base class of all event classes. Event objects contain event parameters. More...

#include <qevent.h>

Inherits Qt.

Inherited by QChildEvent, QCloseEvent, QCustomEvent, QDragLeaveEvent, QDragResponseEvent, QDropEvent, QFocusEvent, QHideEvent, QIMEvent, QKeyEvent, QMouseEvent, QMoveEvent, QPaintEvent, QResizeEvent, QShowEvent, QTimerEvent and QWheelEvent.

List of all member functions.

Public Members

Detailed Description

The QEvent class is base class of all event classes. Event objects contain event parameters.

The main event loop of Qt (QApplication::exec()) fetches native window system events from the event queue, translates them into QEvent and sends the translated events to QObjects.

Generally, events come from the underlying window system, but it is also possible to manually send events through the QApplication class using QApplication::sendEvent() and QApplication::postEvent().

QObject received events by having its QObject::event() function called. The function can be reimplemented in subclasses to customize event handling and add additional event types. QWidget::event() is a notable example. By default, events are dispatched to event handlers like QObject::timerEvent() and QWidget::mouseMoveEvent(). QObject::installEventFilter() allows an object to intercept events to another object.

The basic QEvent only contains an event type parameter. Subclasses of QEvent contain additional parameters that describe the particular event.

See also QObject::event(), QObject::installEventFilter(), QWidget::event(), QApplication::sendEvent(), QAppilcation::postEvent() and QApplication::processEvents().

Member Type Documentation


This enum type defines the valid event types in Qt. The currently defined event types, and the specialized classes for each type, are:

Member Function Documentation

QEvent::QEvent ( Type type )

Contructs an event object with a type.

QEvent::~QEvent () [virtual]

Destructs the event. If it was posted, it will be removed from the list of events to be posted.

QEvent::Type QEvent::type() const

Returns the event type.

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

This file is part of the Qt toolkit, copyright © 1995-2005 Trolltech, all rights reserved.

Copyright © 2005 TrolltechTrademarks
Qt version 2.3.10