QEvent Class Reference


The QEvent class is base class of all event classes. Event objects contain event parameters. (details) (complete member list)

#include <qevent.h>

Inherited by QCloseEvent, QFocusEvent, QKeyEvent, QMouseEvent, QMoveEvent, QPaintEvent, QResizeEvent and QTimerEvent.

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 the events to Qt events and sends those translated events to application objects.

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

Only classes that inherit QObject and reimplement the virtual QObject::event() function may receive events.

The QWidget class reimplements the event() function to dispatch the event to an appropriate virtual function (event handler) on basis of the event type.

QWidget::keyPressEvent() and QWidget::mouseMoveEvent() are examples of widget event handlers.

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

The subclasses of QEvent are: QTimerEvent, QMouseEvent, QKeyEvent, QFocusEvent, QPaintEvent, QMoveEvent, QResizeEvent and QCloseEvent.


Member Function Documentation

QEvent::QEvent (int type)

Contructs an event object with a type. The file qevent.h has a list of all event types.

int QEvent::type () const

Returns the event type.


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

It was generated from the following files:


Generated at 16:17, 1995/06/30 by the webmaster at Troll Tech