Qt logo

QEvent Class Reference


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

#include <qevent.h>

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

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 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 recevied events by having its QObject::event() function called. The default implementation simply calls QObject::timerEvent() for timer events and ignores all other events. QWidget reimplements event() and dispatches incoming events to various event handles such as QWidget::keyPressEvent() and QWidget::mouseMoveEvent().

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

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


Member Function Documentation

QEvent::QEvent ( int type )

Contructs an event object with a type. The file qevent.h lists all event types.

QEvent::~QEvent ()

Destroys the event. Reports an error if the event has been posted.

int QEvent::type () const

Returns the event type.


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


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

It was generated from the following files:


Copyright © 1998 Troll TechTrademarks
Qt version 1.42