[190] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
| 2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/qevent.cpp:43 -->
|
---|
| 3 | <html>
|
---|
| 4 | <head>
|
---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
| 6 | <title>QEvent Class</title>
|
---|
| 7 | <style type="text/css"><!--
|
---|
| 8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
| 9 | a:link { color: #004faf; text-decoration: none }
|
---|
| 10 | a:visited { color: #672967; text-decoration: none }
|
---|
| 11 | body { background: #ffffff; color: black; }
|
---|
| 12 | --></style>
|
---|
| 13 | </head>
|
---|
| 14 | <body>
|
---|
| 15 |
|
---|
| 16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
| 17 | <tr bgcolor="#E5E5E5">
|
---|
| 18 | <td valign=center>
|
---|
| 19 | <a href="index.html">
|
---|
| 20 | <font color="#004faf">Home</font></a>
|
---|
| 21 | | <a href="classes.html">
|
---|
| 22 | <font color="#004faf">All Classes</font></a>
|
---|
| 23 | | <a href="mainclasses.html">
|
---|
| 24 | <font color="#004faf">Main Classes</font></a>
|
---|
| 25 | | <a href="annotated.html">
|
---|
| 26 | <font color="#004faf">Annotated</font></a>
|
---|
| 27 | | <a href="groups.html">
|
---|
| 28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
| 29 | | <a href="functions.html">
|
---|
| 30 | <font color="#004faf">Functions</font></a>
|
---|
| 31 | </td>
|
---|
| 32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QEvent Class Reference</h1>
|
---|
| 33 |
|
---|
| 34 | <p>The QEvent class is the base class of all
|
---|
| 35 | event classes. Event objects contain event parameters.
|
---|
| 36 | <a href="#details">More...</a>
|
---|
| 37 | <p><tt>#include <<a href="qevent-h.html">qevent.h</a>></tt>
|
---|
| 38 | <p>Inherits <a href="qt.html">Qt</a>.
|
---|
| 39 | <p>Inherited by <a href="qtimerevent.html">QTimerEvent</a>, <a href="qmouseevent.html">QMouseEvent</a>, <a href="qwheelevent.html">QWheelEvent</a>, <a href="qtabletevent.html">QTabletEvent</a>, <a href="qkeyevent.html">QKeyEvent</a>, <a href="qfocusevent.html">QFocusEvent</a>, <a href="qpaintevent.html">QPaintEvent</a>, <a href="qmoveevent.html">QMoveEvent</a>, <a href="qresizeevent.html">QResizeEvent</a>, <a href="qcloseevent.html">QCloseEvent</a>, <a href="qicondragevent.html">QIconDragEvent</a>, <a href="qshowevent.html">QShowEvent</a>, <a href="qhideevent.html">QHideEvent</a>, <a href="qcontextmenuevent.html">QContextMenuEvent</a>, <a href="qimevent.html">QIMEvent</a>, <a href="qdropevent.html">QDropEvent</a>, <a href="qdragleaveevent.html">QDragLeaveEvent</a>, <a href="qchildevent.html">QChildEvent</a>, and <a href="qcustomevent.html">QCustomEvent</a>.
|
---|
| 40 | <p><a href="qevent-members.html">List of all member functions.</a>
|
---|
| 41 | <h2>Public Members</h2>
|
---|
| 42 | <ul>
|
---|
| 43 | <li class=fn>enum <a href="#Type-enum"><b>Type</b></a> { 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 }</li>
|
---|
| 44 | <li class=fn><a href="#QEvent"><b>QEvent</b></a> ( Type type )</li>
|
---|
| 45 | <li class=fn>virtual <a href="#~QEvent"><b>~QEvent</b></a> ()</li>
|
---|
| 46 | <li class=fn>Type <a href="#type"><b>type</b></a> () const</li>
|
---|
| 47 | <li class=fn>bool <a href="#spontaneous"><b>spontaneous</b></a> () const</li>
|
---|
| 48 | </ul>
|
---|
| 49 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
| 50 |
|
---|
| 51 |
|
---|
| 52 | The QEvent class is the base class of all
|
---|
| 53 | event classes. Event objects contain event parameters.
|
---|
| 54 | <p>
|
---|
| 55 |
|
---|
| 56 | <p> Qt's main event loop (<a href="qapplication.html#exec">QApplication::exec</a>()) fetches native window
|
---|
| 57 | system events from the event queue, translates them into QEvents
|
---|
| 58 | and sends the translated events to QObjects.
|
---|
| 59 | <p> In general, events come from the underlying window system
|
---|
| 60 | (<a href="#spontaneous">spontaneous</a>() returns TRUE) but it is also possible to manually
|
---|
| 61 | send events using <a href="qapplication.html#sendEvent">QApplication::sendEvent</a>() and
|
---|
| 62 | <a href="qapplication.html#postEvent">QApplication::postEvent</a>() (spontaneous() returns FALSE).
|
---|
| 63 | <p> QObjects receive events by having their <a href="qobject.html#event">QObject::event</a>() function
|
---|
| 64 | called. The function can be reimplemented in subclasses to
|
---|
| 65 | customize event handling and add additional event types;
|
---|
| 66 | <a href="qwidget.html#event">QWidget::event</a>() is a notable example. By default, events are
|
---|
| 67 | dispatched to event handlers like <a href="qobject.html#timerEvent">QObject::timerEvent</a>() and
|
---|
| 68 | <a href="qwidget.html#mouseMoveEvent">QWidget::mouseMoveEvent</a>(). <a href="qobject.html#installEventFilter">QObject::installEventFilter</a>() allows an
|
---|
| 69 | object to intercept events destined for another object.
|
---|
| 70 | <p> The basic QEvent contains only an event type parameter.
|
---|
| 71 | Subclasses of QEvent contain additional parameters that describe
|
---|
| 72 | the particular event.
|
---|
| 73 | <p> <p>See also <a href="qobject.html#event">QObject::event</a>(), <a href="qobject.html#installEventFilter">QObject::installEventFilter</a>(), <a href="qwidget.html#event">QWidget::event</a>(), <a href="qapplication.html#sendEvent">QApplication::sendEvent</a>(), <a href="qapplication.html#postEvent">QApplication::postEvent</a>(), <a href="qapplication.html#processEvents">QApplication::processEvents</a>(), <a href="environment.html">Environment Classes</a>, and <a href="events.html">Event Classes</a>.
|
---|
| 74 |
|
---|
| 75 | <hr><h2>Member Type Documentation</h2>
|
---|
| 76 | <h3 class=fn><a name="Type-enum"></a>QEvent::Type</h3>
|
---|
| 77 |
|
---|
| 78 | <p> This enum type defines the valid event types in Qt. The event
|
---|
| 79 | types and the specialized classes for each type are these:
|
---|
| 80 | <ul>
|
---|
| 81 | <li><tt>QEvent::None</tt> - Not an event.
|
---|
| 82 | <li><tt>QEvent::Accessibility</tt> - Accessibility information is requested
|
---|
| 83 | <li><tt>QEvent::Timer</tt> - Regular timer events, <a href="qtimerevent.html">QTimerEvent</a>.
|
---|
| 84 | <li><tt>QEvent::MouseButtonPress</tt> - Mouse press, <a href="qmouseevent.html">QMouseEvent</a>.
|
---|
| 85 | <li><tt>QEvent::MouseButtonRelease</tt> - Mouse release, <a href="qmouseevent.html">QMouseEvent</a>.
|
---|
| 86 | <li><tt>QEvent::MouseButtonDblClick</tt> - Mouse press again, <a href="qmouseevent.html">QMouseEvent</a>.
|
---|
| 87 | <li><tt>QEvent::MouseMove</tt> - Mouse move, <a href="qmouseevent.html">QMouseEvent</a>.
|
---|
| 88 | <li><tt>QEvent::KeyPress</tt> - Key press (including Shift, for example), <a href="qkeyevent.html">QKeyEvent</a>.
|
---|
| 89 | <li><tt>QEvent::KeyRelease</tt> - Key release, <a href="qkeyevent.html">QKeyEvent</a>.
|
---|
| 90 | <li><tt>QEvent::IMStart</tt> - The start of input method composition, <a href="qimevent.html">QIMEvent</a>.
|
---|
| 91 | <li><tt>QEvent::IMCompose</tt> - Input method composition is taking place, <a href="qimevent.html">QIMEvent</a>.
|
---|
| 92 | <li><tt>QEvent::IMEnd</tt> - The end of input method composition, <a href="qimevent.html">QIMEvent</a>.
|
---|
| 93 | <li><tt>QEvent::FocusIn</tt> - Widget gains <a href="focus.html#keyboard-focus">keyboard focus</a>, <a href="qfocusevent.html">QFocusEvent</a>.
|
---|
| 94 | <li><tt>QEvent::FocusOut</tt> - Widget loses keyboard focus, <a href="qfocusevent.html">QFocusEvent</a>.
|
---|
| 95 | <li><tt>QEvent::Enter</tt> - Mouse enters widget's boundaries.
|
---|
| 96 | <li><tt>QEvent::Leave</tt> - Mouse leaves widget's boundaries.
|
---|
| 97 | <li><tt>QEvent::Paint</tt> - Screen update necessary, <a href="qpaintevent.html">QPaintEvent</a>.
|
---|
| 98 | <li><tt>QEvent::Move</tt> - Widget's position changed, <a href="qmoveevent.html">QMoveEvent</a>.
|
---|
| 99 | <li><tt>QEvent::Resize</tt> - Widget's size changed, <a href="qresizeevent.html">QResizeEvent</a>.
|
---|
| 100 | <li><tt>QEvent::Show</tt> - Widget was shown on screen, <a href="qshowevent.html">QShowEvent</a>.
|
---|
| 101 | <li><tt>QEvent::Hide</tt> - Widget was hidden, <a href="qhideevent.html">QHideEvent</a>.
|
---|
| 102 | <li><tt>QEvent::ShowToParent</tt> - A child widget has been shown.
|
---|
| 103 | <li><tt>QEvent::HideToParent</tt> - A child widget has been hidden.
|
---|
| 104 | <li><tt>QEvent::Close</tt> - Widget was closed (permanently), <a href="qcloseevent.html">QCloseEvent</a>.
|
---|
| 105 | <li><tt>QEvent::ShowNormal</tt> - Widget should be shown normally (obsolete).
|
---|
| 106 | <li><tt>QEvent::ShowMaximized</tt> - Widget should be shown maximized (obsolete).
|
---|
| 107 | <li><tt>QEvent::ShowMinimized</tt> - Widget should be shown minimized (obsolete).
|
---|
| 108 | <li><tt>QEvent::ShowFullScreen</tt> - Widget should be shown full-screen (obsolete).
|
---|
| 109 | <li><tt>QEvent::ShowWindowRequest</tt> - Widget's window should be shown (obsolete).
|
---|
| 110 | <li><tt>QEvent::DeferredDelete</tt> - The object will be deleted after it has
|
---|
| 111 | cleaned up.
|
---|
| 112 | <li><tt>QEvent::Accel</tt> - Key press in child for shortcut key handling, <a href="qkeyevent.html">QKeyEvent</a>.
|
---|
| 113 | <li><tt>QEvent::Wheel</tt> - Mouse wheel rolled, <a href="qwheelevent.html">QWheelEvent</a>.
|
---|
| 114 | <li><tt>QEvent::ContextMenu</tt> - Context popup menu, <a href="qcontextmenuevent.html">QContextMenuEvent</a>
|
---|
| 115 | <li><tt>QEvent::AccelOverride</tt> - Key press in child, for overriding shortcut key handling, <a href="qkeyevent.html">QKeyEvent</a>.
|
---|
| 116 | <li><tt>QEvent::AccelAvailable</tt> - internal.
|
---|
| 117 | <li><tt>QEvent::WindowActivate</tt> - Window was activated.
|
---|
| 118 | <li><tt>QEvent::WindowDeactivate</tt> - Window was deactivated.
|
---|
| 119 | <li><tt>QEvent::CaptionChange</tt> - Widget's caption changed.
|
---|
| 120 | <li><tt>QEvent::IconChange</tt> - Widget's icon changed.
|
---|
| 121 | <li><tt>QEvent::ParentFontChange</tt> - Font of the parent widget changed.
|
---|
| 122 | <li><tt>QEvent::ApplicationFontChange</tt> - Default application font changed.
|
---|
| 123 | <li><tt>QEvent::PaletteChange</tt> - Palette of the widget changed.
|
---|
| 124 | <li><tt>QEvent::ParentPaletteChange</tt> - Palette of the parent widget changed.
|
---|
| 125 | <li><tt>QEvent::ApplicationPaletteChange</tt> - Default application palette changed.
|
---|
| 126 | <li><tt>QEvent::Clipboard</tt> - Clipboard contents have changed.
|
---|
| 127 | <li><tt>QEvent::SockAct</tt> - Socket activated, used to implement <a href="qsocketnotifier.html">QSocketNotifier</a>.
|
---|
| 128 | <li><tt>QEvent::DragEnter</tt> - A drag-and-drop enters widget, <a href="qdragenterevent.html">QDragEnterEvent</a>.
|
---|
| 129 | <li><tt>QEvent::DragMove</tt> - A drag-and-drop is in progress, <a href="qdragmoveevent.html">QDragMoveEvent</a>.
|
---|
| 130 | <li><tt>QEvent::DragLeave</tt> - A drag-and-drop leaves widget, <a href="qdragleaveevent.html">QDragLeaveEvent</a>.
|
---|
| 131 | <li><tt>QEvent::Drop</tt> - A drag-and-drop is completed, <a href="qdropevent.html">QDropEvent</a>.
|
---|
| 132 | <li><tt>QEvent::DragResponse</tt> - Internal event used by Qt on some platforms.
|
---|
| 133 | <li><tt>QEvent::ChildInserted</tt> - Object gets a child, <a href="qchildevent.html">QChildEvent</a>.
|
---|
| 134 | <li><tt>QEvent::ChildRemoved</tt> - Object loses a child, <a href="qchildevent.html">QChildEvent</a>.
|
---|
| 135 | <li><tt>QEvent::LayoutHint</tt> - Widget child has changed layout properties.
|
---|
| 136 | <li><tt>QEvent::ActivateControl</tt> - Internal event used by Qt on some platforms.
|
---|
| 137 | <li><tt>QEvent::DeactivateControl</tt> - Internal event used by Qt on some platforms.
|
---|
| 138 | <li><tt>QEvent::LanguageChange</tt> - The application translation changed, <a href="qtranslator.html">QTranslator</a>
|
---|
| 139 | <li><tt>QEvent::LayoutDirectionChange</tt> - The direction of layouts changed
|
---|
| 140 | <li><tt>QEvent::LocaleChange</tt> - The system locale changed
|
---|
| 141 | <li><tt>QEvent::Quit</tt> - Reserved.
|
---|
| 142 | <li><tt>QEvent::Create</tt> - Reserved.
|
---|
| 143 | <li><tt>QEvent::Destroy</tt> - Reserved.
|
---|
| 144 | <li><tt>QEvent::Reparent</tt> - Reserved.
|
---|
| 145 | <li><tt>QEvent::Speech</tt> - Reserved for speech input.
|
---|
| 146 | <li><tt>QEvent::TabletMove</tt> - A Wacom Tablet Move Event.
|
---|
| 147 | <li><tt>QEvent::Style</tt> - Internal use only
|
---|
| 148 | <li><tt>QEvent::TabletPress</tt> - A Wacom Tablet Press Event
|
---|
| 149 | <li><tt>QEvent::TabletRelease</tt> - A Wacom Tablet Release Event
|
---|
| 150 | <li><tt>QEvent::OkRequest</tt> - Internal event used by Qt on some platforms.
|
---|
| 151 | <li><tt>QEvent::HelpRequest</tt> - Internal event used by Qt on some platforms.
|
---|
| 152 | <li><tt>QEvent::IconDrag</tt> - Internal event used by Qt on some platforms when proxy icon is dragged.
|
---|
| 153 | <li><tt>QEvent::WindowStateChange</tt> - The window's state, i.e. minimized,
|
---|
| 154 | maximized or full-screen, has changed. See <a href="qwidget.html#windowState">QWidget::windowState</a>().
|
---|
| 155 | <li><tt>QEvent::WindowBlocked</tt> - The window is modally blocked
|
---|
| 156 | <li><tt>QEvent::WindowUnblocked</tt> - The window leaves modal blocking
|
---|
| 157 | <li><tt>QEvent::User</tt> - User defined event.
|
---|
| 158 | <li><tt>QEvent::MaxUser</tt> - Last user event id.
|
---|
| 159 | </ul><p> User events should have values between User and MaxUser inclusive.
|
---|
| 160 |
|
---|
| 161 | <hr><h2>Member Function Documentation</h2>
|
---|
| 162 | <h3 class=fn><a name="QEvent"></a>QEvent::QEvent ( <a href="qevent.html#Type-enum">Type</a> type )
|
---|
| 163 | </h3>
|
---|
| 164 |
|
---|
| 165 | <p> Contructs an event object of type <em>type</em>.
|
---|
| 166 |
|
---|
| 167 | <h3 class=fn><a name="~QEvent"></a>QEvent::~QEvent ()<tt> [virtual]</tt>
|
---|
| 168 | </h3>
|
---|
| 169 | Destroys the event. If it was <a href="qapplication.html#postEvent">posted</a>,
|
---|
| 170 | it will be removed from the list of events to be posted.
|
---|
| 171 |
|
---|
| 172 | <h3 class=fn>bool <a name="spontaneous"></a>QEvent::spontaneous () const
|
---|
| 173 | </h3>
|
---|
| 174 |
|
---|
| 175 | <p> Returns TRUE if the event originated outside the application, i.e.
|
---|
| 176 | it is a system event; otherwise returns FALSE.
|
---|
| 177 |
|
---|
| 178 | <h3 class=fn><a href="qevent.html#Type-enum">Type</a> <a name="type"></a>QEvent::type () const
|
---|
| 179 | </h3>
|
---|
| 180 |
|
---|
| 181 | <p> Returns the event type.
|
---|
| 182 |
|
---|
| 183 | <!-- eof -->
|
---|
| 184 | <hr><p>
|
---|
| 185 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
| 186 | Copyright © 1995-2007
|
---|
| 187 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
| 188 | <table width=100% cellspacing=0 border=0><tr>
|
---|
| 189 | <td>Copyright © 2007
|
---|
| 190 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
| 191 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
| 192 | </table></div></address></body>
|
---|
| 193 | </html>
|
---|