File: qeventtransition.html

package info (click to toggle)
python-qt4 4.7.3-1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 28,504 kB
  • ctags: 4,680
  • sloc: python: 28,738; cpp: 8,897; sh: 245; xml: 243; makefile: 150
file content (36 lines) | stat: -rw-r--r-- 6,912 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QEventTransition Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QEventTransition Class Reference<br /><sup><sup>[<a href="qtcore.html">QtCore</a> module]</sup></sup></h1><p>The QEventTransition class provides a <a href="qobject.html">QObject</a>-specific transition for Qt events. <a href="#details">More...</a></p>
<p>Inherits <a href="qabstracttransition.html">QAbstractTransition</a>.</p><p>Inherited by <a href="qkeyeventtransition.html">QKeyEventTransition</a> and <a href="qmouseeventtransition.html">QMouseEventTransition</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qeventtransition.html#QEventTransition">__init__</a></b> (<i>self</i>, QState&#160;<i>sourceState</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qeventtransition.html#QEventTransition-2">__init__</a></b> (<i>self</i>, QObject, QEvent.Type, QState&#160;<i>sourceState</i>&#160;=&#160;None)</li><li><div class="fn" />bool <b><a href="qeventtransition.html#event">event</a></b> (<i>self</i>, QEvent)</li><li><div class="fn" />QObject <b><a href="qeventtransition.html#eventSource">eventSource</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qeventtransition.html#eventTest">eventTest</a></b> (<i>self</i>, QEvent)</li><li><div class="fn" />QEvent.Type <b><a href="qeventtransition.html#eventType">eventType</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qeventtransition.html#onTransition">onTransition</a></b> (<i>self</i>, QEvent)</li><li><div class="fn" /><b><a href="qeventtransition.html#setEventSource">setEventSource</a></b> (<i>self</i>, QObject)</li><li><div class="fn" /><b><a href="qeventtransition.html#setEventType">setEventType</a></b> (<i>self</i>, QEvent.Type)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QEventTransition class provides a <a href="qobject.html">QObject</a>-specific transition for Qt events.</p>
<p>A QEventTransition object binds an event to a particular <a href="qobject.html">QObject</a>. QEventTransition is part of <a href="statemachine-api.html">The State Machine Framework</a>.</p>
<p>Example:</p>
<pre> QPushButton *button = ...;
 QState *s1 = ...;
 QState *s2 = ...;
<span class="comment"> // If in s1 and the button receives an Enter event, transition to s2</span>
 QEventTransition *enterTransition = new QEventTransition(button, QEvent.Enter);
 enterTransition-&gt;setTargetState(s2);
 s1-&gt;addTransition(enterTransition);
<span class="comment"> // If in s2 and the button receives an Exit event, transition back to s1</span>
 QEventTransition *leaveTransition = new QEventTransition(button, QEvent.Leave);
 leaveTransition-&gt;setTargetState(s1);
 s2-&gt;addTransition(leaveTransition);</pre>
<a name="subclassing" />
<h3>Subclassing</h3>
<p>When reimplementing the <a href="qeventtransition.html#eventTest">eventTest</a>() function, you should first call the base implementation to verify that the event is a <a href="qstatemachine-wrappedevent.html">QStateMachine.WrappedEvent</a> for the proper object and event type. You may then cast the event to a <a href="qstatemachine-wrappedevent.html">QStateMachine.WrappedEvent</a> and get the original event by calling <a href="qstatemachine-wrappedevent.html#event">QStateMachine.WrappedEvent.event</a>(), and perform additional checks on that object.</p>
<p>See also <a href="qstate.html#addTransition">QState.addTransition</a>().</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QEventTransition" />QEventTransition.__init__ (<i>self</i>, <a href="qstate.html">QState</a>&#160;<i>sourceState</i>&#160;=&#160;None)</h3><p>Constructs a new <a href="qeventtransition.html">QEventTransition</a> object with the given <i>sourceState</i>.</p>
<h3 class="fn"><a name="QEventTransition-2" />QEventTransition.__init__ (<i>self</i>, <a href="qobject.html">QObject</a>, <a href="qevent.html#Type-enum">QEvent.Type</a>, <a href="qstate.html">QState</a>&#160;<i>sourceState</i>&#160;=&#160;None)</h3><p>Constructs a new <a href="qeventtransition.html">QEventTransition</a> object associated with events of the given <i>type</i> for the given <i>object</i>, and with the given <i>sourceState</i>.</p>
<a name="//apple_ref/cpp/instm/QEventTransition/~QEventTransition" />
<h3 class="fn"><a name="event" />bool QEventTransition.event (<i>self</i>, <a href="qevent.html">QEvent</a>)</h3><p>Reimplemented from <a href="qobject.html#event">QObject.event</a>().</p>
<a name="//apple_ref/cpp/instm/QEventTransition/eventTest" />
<h3 class="fn"><a name="eventSource" /><a href="qobject.html">QObject</a> QEventTransition.eventSource (<i>self</i>)</h3><h3 class="fn"><a name="eventTest" />bool QEventTransition.eventTest (<i>self</i>, <a href="qevent.html">QEvent</a>)</h3><p>Reimplemented from <a href="qabstracttransition.html#eventTest">QAbstractTransition.eventTest</a>().</p>
<a name="//apple_ref/cpp/instm/QEventTransition/onTransition" />
<h3 class="fn"><a name="eventType" /><a href="qevent.html#Type-enum">QEvent.Type</a> QEventTransition.eventType (<i>self</i>)</h3><h3 class="fn"><a name="onTransition" />QEventTransition.onTransition (<i>self</i>, <a href="qevent.html">QEvent</a>)</h3><p>Reimplemented from <a href="qabstracttransition.html#onTransition">QAbstractTransition.onTransition</a>().</p>
<p /><h3 class="fn"><a name="setEventSource" />QEventTransition.setEventSource (<i>self</i>, <a href="qobject.html">QObject</a>)</h3><h3 class="fn"><a name="setEventType" />QEventTransition.setEventType (<i>self</i>, <a href="qevent.html#Type-enum">QEvent.Type</a>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.7.3 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt&#160;4.6.2</td></tr></table></div></address></body></html>