[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:1549 -->
|
---|
| 3 | <html>
|
---|
| 4 | <head>
|
---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
| 6 | <title>QContextMenuEvent 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>QContextMenuEvent Class Reference</h1>
|
---|
| 33 |
|
---|
| 34 | <p>The QContextMenuEvent class contains parameters that describe a context menu event.
|
---|
| 35 | <a href="#details">More...</a>
|
---|
| 36 | <p><tt>#include <<a href="qevent-h.html">qevent.h</a>></tt>
|
---|
| 37 | <p>Inherits <a href="qevent.html">QEvent</a>.
|
---|
| 38 | <p><a href="qcontextmenuevent-members.html">List of all member functions.</a>
|
---|
| 39 | <h2>Public Members</h2>
|
---|
| 40 | <ul>
|
---|
| 41 | <li class=fn>enum <a href="#Reason-enum"><b>Reason</b></a> { Mouse, Keyboard, Other }</li>
|
---|
| 42 | <li class=fn><a href="#QContextMenuEvent"><b>QContextMenuEvent</b></a> ( Reason reason, const QPoint & pos, const QPoint & globalPos, int state )</li>
|
---|
| 43 | <li class=fn><a href="#QContextMenuEvent-2"><b>QContextMenuEvent</b></a> ( Reason reason, const QPoint & pos, int state )</li>
|
---|
| 44 | <li class=fn>int <a href="#x"><b>x</b></a> () const</li>
|
---|
| 45 | <li class=fn>int <a href="#y"><b>y</b></a> () const</li>
|
---|
| 46 | <li class=fn>int <a href="#globalX"><b>globalX</b></a> () const</li>
|
---|
| 47 | <li class=fn>int <a href="#globalY"><b>globalY</b></a> () const</li>
|
---|
| 48 | <li class=fn>const QPoint & <a href="#pos"><b>pos</b></a> () const</li>
|
---|
| 49 | <li class=fn>const QPoint & <a href="#globalPos"><b>globalPos</b></a> () const</li>
|
---|
| 50 | <li class=fn>ButtonState <a href="#state"><b>state</b></a> () const</li>
|
---|
| 51 | <li class=fn>bool <a href="#isAccepted"><b>isAccepted</b></a> () const</li>
|
---|
| 52 | <li class=fn>bool <a href="#isConsumed"><b>isConsumed</b></a> () const</li>
|
---|
| 53 | <li class=fn>void <a href="#consume"><b>consume</b></a> ()</li>
|
---|
| 54 | <li class=fn>void <a href="#accept"><b>accept</b></a> ()</li>
|
---|
| 55 | <li class=fn>void <a href="#ignore"><b>ignore</b></a> ()</li>
|
---|
| 56 | <li class=fn>Reason <a href="#reason"><b>reason</b></a> () const</li>
|
---|
| 57 | </ul>
|
---|
| 58 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
| 59 |
|
---|
| 60 |
|
---|
| 61 | The QContextMenuEvent class contains parameters that describe a context menu event.
|
---|
| 62 | <p>
|
---|
| 63 | <p> Context menu events are sent to widgets when a user triggers a
|
---|
| 64 | context menu. What triggers this is platform dependent. For
|
---|
| 65 | example, on Windows, pressing the menu button or releasing the
|
---|
| 66 | right mouse button will cause this event to be sent.
|
---|
| 67 | <p> When this event occurs it is customary to show a <a href="qpopupmenu.html">QPopupMenu</a> with a
|
---|
| 68 | context menu, if this is relevant to the context.
|
---|
| 69 | <p> Context menu events contain a special accept flag that indicates
|
---|
| 70 | whether the receiver accepted the event. If the event handler does
|
---|
| 71 | not accept the event, then whatever triggered the event will be
|
---|
| 72 | handled as a regular input event if possible.
|
---|
| 73 | <p> <p>See also <a href="qpopupmenu.html">QPopupMenu</a> and <a href="events.html">Event Classes</a>.
|
---|
| 74 |
|
---|
| 75 | <hr><h2>Member Type Documentation</h2>
|
---|
| 76 | <h3 class=fn><a name="Reason-enum"></a>QContextMenuEvent::Reason</h3>
|
---|
| 77 |
|
---|
| 78 | <p> This enum describes the reason the ContextMenuEvent was sent. The
|
---|
| 79 | values are:
|
---|
| 80 | <ul>
|
---|
| 81 | <li><tt>QContextMenuEvent::Mouse</tt> - The mouse caused the event to be sent. Normally this
|
---|
| 82 | means the right mouse button was clicked, but this is platform
|
---|
| 83 | specific.
|
---|
| 84 | <li><tt>QContextMenuEvent::Keyboard</tt> - The keyboard caused this event to be sent. On
|
---|
| 85 | Windows this means the menu button was pressed.
|
---|
| 86 | <li><tt>QContextMenuEvent::Other</tt> - The event was sent by some other means (i.e. not by
|
---|
| 87 | the mouse or keyboard).
|
---|
| 88 | </ul>
|
---|
| 89 | <hr><h2>Member Function Documentation</h2>
|
---|
| 90 | <h3 class=fn><a name="QContextMenuEvent"></a>QContextMenuEvent::QContextMenuEvent ( <a href="qcontextmenuevent.html#Reason-enum">Reason</a> reason, const <a href="qpoint.html">QPoint</a> & pos, const <a href="qpoint.html">QPoint</a> & globalPos, int state )
|
---|
| 91 | </h3>
|
---|
| 92 |
|
---|
| 93 | <p> Constructs a context menu event object with the accept parameter
|
---|
| 94 | flag set to FALSE.
|
---|
| 95 | <p> The <em>reason</em> parameter must be <a href="#Reason-enum">QContextMenuEvent::Mouse</a> or <a href="#Reason-enum">QContextMenuEvent::Keyboard</a>.
|
---|
| 96 | <p> The <em>pos</em> parameter specifies the mouse position relative to the
|
---|
| 97 | receiving widget. <em>globalPos</em> is the mouse position in absolute
|
---|
| 98 | coordinates. <em>state</em> is the ButtonState at the time of the event.
|
---|
| 99 |
|
---|
| 100 | <h3 class=fn><a name="QContextMenuEvent-2"></a>QContextMenuEvent::QContextMenuEvent ( <a href="qcontextmenuevent.html#Reason-enum">Reason</a> reason, const <a href="qpoint.html">QPoint</a> & pos, int state )
|
---|
| 101 | </h3>
|
---|
| 102 |
|
---|
| 103 | <p> Constructs a context menu event object with the accept parameter
|
---|
| 104 | flag set to FALSE.
|
---|
| 105 | <p> The <em>reason</em> parameter must be <a href="#Reason-enum">QContextMenuEvent::Mouse</a> or <a href="#Reason-enum">QContextMenuEvent::Keyboard</a>.
|
---|
| 106 | <p> The <em>pos</em> parameter specifies the mouse position relative to the
|
---|
| 107 | receiving widget. <em>state</em> is the ButtonState at the time of the
|
---|
| 108 | event.
|
---|
| 109 | <p> The <a href="#globalPos">globalPos</a>() is initialized to <a href="qcursor.html#pos">QCursor::pos</a>(), which may not be
|
---|
| 110 | appropriate. Use the other constructor to specify the global
|
---|
| 111 | position explicitly.
|
---|
| 112 |
|
---|
| 113 | <h3 class=fn>void <a name="accept"></a>QContextMenuEvent::accept ()
|
---|
| 114 | </h3>
|
---|
| 115 |
|
---|
| 116 | <p> Sets the accept flag of the context event object.
|
---|
| 117 | <p> Setting the accept flag indicates that the receiver of this event
|
---|
| 118 | has processed the event. Processing the event means you did
|
---|
| 119 | something with it and it will be implicitly consumed.
|
---|
| 120 | <p> The accept flag is not set by default.
|
---|
| 121 | <p> <p>See also <a href="#ignore">ignore</a>() and <a href="#consume">consume</a>().
|
---|
| 122 |
|
---|
| 123 | <h3 class=fn>void <a name="consume"></a>QContextMenuEvent::consume ()
|
---|
| 124 | </h3>
|
---|
| 125 |
|
---|
| 126 | <p> Sets the consume flag of the context event object.
|
---|
| 127 | <p> Setting the consume flag indicates that the receiver of this event
|
---|
| 128 | does not want the event to be propagated further (i.e. not sent to
|
---|
| 129 | parent classes.)
|
---|
| 130 | <p> The consumed flag is not set by default.
|
---|
| 131 | <p> <p>See also <a href="#ignore">ignore</a>() and <a href="#accept">accept</a>().
|
---|
| 132 |
|
---|
| 133 | <h3 class=fn>const <a href="qpoint.html">QPoint</a> & <a name="globalPos"></a>QContextMenuEvent::globalPos () const
|
---|
| 134 | </h3>
|
---|
| 135 |
|
---|
| 136 | <p> Returns the global position of the mouse pointer at the time of
|
---|
| 137 | the event.
|
---|
| 138 | <p> <p>See also <a href="#x">x</a>(), <a href="#y">y</a>(), and <a href="#pos">pos</a>().
|
---|
| 139 |
|
---|
| 140 | <h3 class=fn>int <a name="globalX"></a>QContextMenuEvent::globalX () const
|
---|
| 141 | </h3>
|
---|
| 142 |
|
---|
| 143 | <p> Returns the global x-position of the mouse pointer at the time of
|
---|
| 144 | the event.
|
---|
| 145 | <p> <p>See also <a href="#globalY">globalY</a>() and <a href="#globalPos">globalPos</a>().
|
---|
| 146 |
|
---|
| 147 | <h3 class=fn>int <a name="globalY"></a>QContextMenuEvent::globalY () const
|
---|
| 148 | </h3>
|
---|
| 149 |
|
---|
| 150 | <p> Returns the global y-position of the mouse pointer at the time of
|
---|
| 151 | the event.
|
---|
| 152 | <p> <p>See also <a href="#globalX">globalX</a>() and <a href="#globalPos">globalPos</a>().
|
---|
| 153 |
|
---|
| 154 | <h3 class=fn>void <a name="ignore"></a>QContextMenuEvent::ignore ()
|
---|
| 155 | </h3>
|
---|
| 156 |
|
---|
| 157 | <p> Clears the accept flag of the context event object.
|
---|
| 158 | <p> Clearing the accept flag indicates that the receiver of this event
|
---|
| 159 | does not need to show a context menu. This will implicitly remove
|
---|
| 160 | the consumed flag as well.
|
---|
| 161 | <p> The accept flag is not set by default.
|
---|
| 162 | <p> <p>See also <a href="#accept">accept</a>() and <a href="#consume">consume</a>().
|
---|
| 163 |
|
---|
| 164 | <h3 class=fn>bool <a name="isAccepted"></a>QContextMenuEvent::isAccepted () const
|
---|
| 165 | </h3>
|
---|
| 166 |
|
---|
| 167 | <p> Returns TRUE if the receiver has processed the event; otherwise
|
---|
| 168 | returns FALSE.
|
---|
| 169 | <p> <p>See also <a href="#accept">accept</a>(), <a href="#ignore">ignore</a>(), and <a href="#consume">consume</a>().
|
---|
| 170 |
|
---|
| 171 | <h3 class=fn>bool <a name="isConsumed"></a>QContextMenuEvent::isConsumed () const
|
---|
| 172 | </h3>
|
---|
| 173 |
|
---|
| 174 | <p> Returns TRUE (which stops propagation of the event) if the
|
---|
| 175 | receiver has blocked the event; otherwise returns FALSE.
|
---|
| 176 | <p> <p>See also <a href="#accept">accept</a>(), <a href="#ignore">ignore</a>(), and <a href="#consume">consume</a>().
|
---|
| 177 |
|
---|
| 178 | <h3 class=fn>const <a href="qpoint.html">QPoint</a> & <a name="pos"></a>QContextMenuEvent::pos () const
|
---|
| 179 | </h3>
|
---|
| 180 |
|
---|
| 181 | <p> Returns the position of the mouse pointer relative to the widget
|
---|
| 182 | that received the event.
|
---|
| 183 | <p> <p>See also <a href="#x">x</a>(), <a href="#y">y</a>(), and <a href="#globalPos">globalPos</a>().
|
---|
| 184 |
|
---|
| 185 | <h3 class=fn><a href="qcontextmenuevent.html#Reason-enum">Reason</a> <a name="reason"></a>QContextMenuEvent::reason () const
|
---|
| 186 | </h3>
|
---|
| 187 |
|
---|
| 188 | <p> Returns the reason for this context event.
|
---|
| 189 |
|
---|
| 190 | <h3 class=fn><a href="qt.html#ButtonState-enum">ButtonState</a> <a name="state"></a>QContextMenuEvent::state () const
|
---|
| 191 | </h3>
|
---|
| 192 |
|
---|
| 193 | <p> Returns the button state (a combination of mouse buttons and
|
---|
| 194 | keyboard modifiers), i.e. what buttons and keys were being
|
---|
| 195 | pressed immediately before the event was generated.
|
---|
| 196 | <p> The returned value is <a href="qt.html#ButtonState-enum">LeftButton</a>, <a href="qt.html#ButtonState-enum">RightButton</a>, <a href="qt.html#ButtonState-enum">MidButton</a>,
|
---|
| 197 | <a href="qt.html#ButtonState-enum">ShiftButton</a>, <a href="qt.html#ButtonState-enum">ControlButton</a> and <a href="qt.html#ButtonState-enum">AltButton</a> OR'ed together.
|
---|
| 198 |
|
---|
| 199 | <h3 class=fn>int <a name="x"></a>QContextMenuEvent::x () const
|
---|
| 200 | </h3>
|
---|
| 201 |
|
---|
| 202 | <p> Returns the x-position of the mouse pointer, relative to the
|
---|
| 203 | widget that received the event.
|
---|
| 204 | <p> <p>See also <a href="#y">y</a>() and <a href="#pos">pos</a>().
|
---|
| 205 |
|
---|
| 206 | <h3 class=fn>int <a name="y"></a>QContextMenuEvent::y () const
|
---|
| 207 | </h3>
|
---|
| 208 |
|
---|
| 209 | <p> Returns the y-position of the mouse pointer, relative to the
|
---|
| 210 | widget that received the event.
|
---|
| 211 | <p> <p>See also <a href="#x">x</a>() and <a href="#pos">pos</a>().
|
---|
| 212 |
|
---|
| 213 | <!-- eof -->
|
---|
| 214 | <hr><p>
|
---|
| 215 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
| 216 | Copyright © 1995-2007
|
---|
| 217 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
| 218 | <table width=100% cellspacing=0 border=0><tr>
|
---|
| 219 | <td>Copyright © 2007
|
---|
| 220 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
| 221 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
| 222 | </table></div></address></body>
|
---|
| 223 | </html>
|
---|