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 <ntqevent.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

- enum Type { None = 0, Timer = 1, MouseButtonPress = 2, MouseButtonRelease = 3, MouseButtonDblClick = 4, MouseMove = 5, KeyPress = 6, KeyRelease = 7, FocusIn = 8, FocusOut = 9, Enter = 10, Leave = 11, Paint = 12, Move = 13, Resize = 14, Create = 15, Destroy = 16, Show = 17, Hide = 18, Close = 19, Quit = 20, Reparent = 21, ShowMinimized = 22, ShowNormal = 23, WindowActivate = 24, WindowDeactivate = 25, ShowToParent = 26, HideToParent = 27, ShowMaximized = 28, ShowFullScreen = 29, Accel = 30, Wheel = 31, AccelAvailable = 32, CaptionChange = 33, IconChange = 34, ParentFontChange = 35, ApplicationFontChange = 36, ParentPaletteChange = 37, ApplicationPaletteChange = 38, PaletteChange = 39, Clipboard = 40, Speech = 42, SockAct = 50, AccelOverride = 51, DeferredDelete = 52, DragEnter = 60, DragMove = 61, DragLeave = 62, Drop = 63, DragResponse = 64, ChildInserted = 70, ChildRemoved = 71, LayoutHint = 72, ShowWindowRequest = 73, WindowBlocked = 74, WindowUnblocked = 75, ActivateControl = 80, DeactivateControl = 81, ContextMenu = 82, IMStart = 83, IMCompose = 84, IMEnd = 85, Accessibility = 86, TabletMove = 87, LocaleChange = 88, LanguageChange = 89, LayoutDirectionChange = 90, Style = 91, TabletPress = 92, TabletRelease = 93, OkRequest = 94, HelpRequest = 95, WindowStateChange = 96, IconDrag = 97, User = 1000, MaxUser = 65535 }
- TQEvent ( Type type )
- virtual ~TQEvent ()
- Type type () const
- bool spontaneous () const

## 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:

- `TQEvent::None` - Not an event.
- `TQEvent::Accessibility` - Accessibility information is requested
- `TQEvent::Timer` - Regular timer events, TQTimerEvent.
- `TQEvent::MouseButtonPress` - Mouse press, TQMouseEvent.
- `TQEvent::MouseButtonRelease` - Mouse release, TQMouseEvent.
- `TQEvent::MouseButtonDblClick` - Mouse press again, TQMouseEvent.
- `TQEvent::MouseMove` - Mouse move, TQMouseEvent.
- `TQEvent::KeyPress` - Key press (including Shift, for example), TQKeyEvent.
- `TQEvent::KeyRelease` - Key release, TQKeyEvent.
- `TQEvent::IMStart` - The start of input method composition, TQIMEvent.
- `TQEvent::IMCompose` - Input method composition is taking place, TQIMEvent.
- `TQEvent::IMEnd` - The end of input method composition, TQIMEvent.
- `TQEvent::FocusIn` - Widget gains keyboard focus, TQFocusEvent.
- `TQEvent::FocusOut` - Widget loses keyboard focus, TQFocusEvent.
- `TQEvent::Enter` - Mouse enters widget's boundaries.
- `TQEvent::Leave` - Mouse leaves widget's boundaries.
- `TQEvent::Paint` - Screen update necessary, TQPaintEvent.
- `TQEvent::Move` - Widget's position changed, TQMoveEvent.
- `TQEvent::Resize` - Widget's size changed, TQResizeEvent.
- `TQEvent::Show` - Widget was shown on screen, TQShowEvent.
- `TQEvent::Hide` - Widget was hidden, TQHideEvent.
- `TQEvent::ShowToParent` - A child widget has been shown.
- `TQEvent::HideToParent` - A child widget has been hidden.
- `TQEvent::Close` - Widget was closed (permanently), TQCloseEvent.
- `TQEvent::ShowNormal` - Widget should be shown normally (obsolete).
- `TQEvent::ShowMaximized` - Widget should be shown maximized (obsolete).
- `TQEvent::ShowMinimized` - Widget should be shown minimized (obsolete).
- `TQEvent::ShowFullScreen` - Widget should be shown full-screen (obsolete).
- `TQEvent::ShowWindowRequest` - Widget's window should be shown (obsolete).
- `TQEvent::DeferredDelete` - The object will be deleted after it has cleaned up.
- `TQEvent::Accel` - Key press in child for shortcut key handling, TQKeyEvent.
- `TQEvent::Wheel` - Mouse wheel rolled, TQWheelEvent.
- `TQEvent::ContextMenu` - Context popup menu, TQContextMenuEvent
- `TQEvent::AccelOverride` - Key press in child, for overriding shortcut key handling, TQKeyEvent.
- `TQEvent::AccelAvailable` - internal.
- `TQEvent::WindowActivate` - Window was activated.
- `TQEvent::WindowDeactivate` - Window was deactivated.
- `TQEvent::CaptionChange` - Widget's caption changed.
- `TQEvent::IconChange` - Widget's icon changed.
- `TQEvent::ParentFontChange` - Font of the parent widget changed.
- `TQEvent::ApplicationFontChange` - Default application font changed.
- `TQEvent::PaletteChange` - Palette of the widget changed.
- `TQEvent::ParentPaletteChange` - Palette of the parent widget changed.
- `TQEvent::ApplicationPaletteChange` - Default application palette changed.
- `TQEvent::Clipboard` - Clipboard contents have changed.
- `TQEvent::SockAct` - Socket activated, used to implement TQSocketNotifier.
- `TQEvent::DragEnter` - A drag-and-drop enters widget, TQDragEnterEvent.
- `TQEvent::DragMove` - A drag-and-drop is in progress, TQDragMoveEvent.
- `TQEvent::DragLeave` - A drag-and-drop leaves widget, TQDragLeaveEvent.
- `TQEvent::Drop` - A drag-and-drop is completed, TQDropEvent.
- `TQEvent::DragResponse` - Internal event used by TQt on some platforms.
- `TQEvent::ChildInserted` - Object gets a child, TQChildEvent.
- `TQEvent::ChildRemoved` - Object loses a child, TQChildEvent.
- `TQEvent::LayoutHint` - Widget child has changed layout properties.
- `TQEvent::ActivateControl` - Internal event used by TQt on some platforms.
- `TQEvent::DeactivateControl` - Internal event used by TQt on some platforms.
- `TQEvent::LanguageChange` - The application translation changed, TQTranslator
- `TQEvent::LayoutDirectionChange` - The direction of layouts changed
- `TQEvent::LocaleChange` - The system locale changed
- `TQEvent::Quit` - Reserved.
- `TQEvent::Create` - Reserved.
- `TQEvent::Destroy` - Reserved.
- `TQEvent::Reparent` - Reserved.
- `TQEvent::Speech` - Reserved for speech input.
- `TQEvent::TabletMove` - A Wacom Tablet Move Event.
- `TQEvent::Style` - Internal use only
- `TQEvent::TabletPress` - A Wacom Tablet Press Event
- `TQEvent::TabletRelease` - A Wacom Tablet Release Event
- `TQEvent::OkRequest` - Internal event used by TQt on some platforms.
- `TQEvent::HelpRequest` - Internal event used by TQt on some platforms.
- `TQEvent::IconDrag` - Internal event used by TQt on some platforms when proxy icon is dragged.
- `TQEvent::WindowStateChange` - The window's state, i.e. minimized, maximized or full-screen, has changed. See TQWidget::windowState().
- `TQEvent::WindowBlocked` - The window is modally blocked
- `TQEvent::WindowUnblocked` - The window leaves modal blocking
- `TQEvent::User` - User defined event.
- `TQEvent::MaxUser` - Last user event id.

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.