Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions

TQEvent Class Reference

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

#include <tqevent.h>

Inherits TQt.

Inherited by TQTimerEvent, TQMouseEvent, TQWheelEvent, TQTabletEvent, TQKeyEvent, TQFocusEvent, TQPaintEvent, TQMoveEvent, TQResizeEvent, TQCloseEvent, TQIconDragEvent, TQShowEvent, TQHideEvent, TQContextMenuEvent, TQIMEvent, TQDropEvent, TQDragLeaveEvent, TQChildEvent, and TQCustomEvent.

List of all member functions.

Public Members


Detailed Description

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

TQt's main event loop (TQApplication::exec()) fetches native window system events from the event queue, translates them into TQEvents and sends the translated events to TQObjects.

In general, events come from the underlying window system (spontaneous() returns TRUE) but it is also possible to manually send events using TQApplication::sendEvent() and TQApplication::postEvent() (spontaneous() returns FALSE).

TQObjects receive events by having their TQObject::event() function called. The function can be reimplemented in subclasses to customize event handling and add additional event types; TQWidget::event() is a notable example. By default, events are dispatched to event handlers like TQObject::timerEvent() and TQWidget::mouseMoveEvent(). TQObject::installEventFilter() allows an object to intercept events destined for another object.

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

See also TQObject::event(), TQObject::installEventFilter(), TQWidget::event(), TQApplication::sendEvent(), TQApplication::postEvent(), TQApplication::processEvents(), Environment Classes, and Event Classes.


Member Type Documentation

TQEvent::Type

This enum type defines the valid event types in TQt. The event types and the specialized classes for each type are these:

User events should have values between User and MaxUser inclusive.


Member Function Documentation

TQEvent::TQEvent ( Type type )

Contructs an event object of type type.

TQEvent::~TQEvent () [virtual]

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

bool TQEvent::spontaneous () const

Returns TRUE if the event originated outside the application, i.e. it is a system event; otherwise returns FALSE.

Type TQEvent::type () const

Returns the event type.


This file is part of the TQt toolkit. Copyright © 1995-2007 Trolltech. All Rights Reserved.


Copyright © 2007 TrolltechTrademarks
TQt 3.3.8