QEvent Class Reference


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

#include <qevent.h>

Inherited by QCloseEvent, QCustomEvent, QFocusEvent, QKeyEvent, QMouseEvent, QMoveEvent, QPaintEvent, QResizeEvent 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 to Qt events and sends the 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 using 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 an event to an appropriate event handler (virtual function) on basis of the event type.

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

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


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.


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

It was generated from the following files:


Generated at 13:30, 1998/01/15 for Qt version 1.32 by the webmaster at Troll Tech