<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <!-- qabstractstate.cpp --> <head> <title>Qt 4.6: QAbstractState Class Reference</title> <link href="classic.css" rel="stylesheet" type="text/css" /> </head> <body> <a name="//apple_ref/cpp/cl//QAbstractState"></a> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td> <td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="functions.html"><font color="#004faf">All Functions</font></a> · <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">QAbstractState Class Reference<br /><span class="small-subtitle">[<a href="qtcore.html">QtCore</a> module]</span> </h1> <p>The QAbstractState class is the base class of states of a <a href="qstatemachine.html">QStateMachine</a>. <a href="#details">More...</a></p> <pre> #include <QAbstractState></pre><p>Inherits <a href="qobject.html">QObject</a>.</p> <p>Inherited by <a href="qfinalstate.html">QFinalState</a>, <a href="qhistorystate.html">QHistoryState</a>, and <a href="qstate.html">QState</a>.</p> <p>This class was introduced in Qt 4.6.</p> <ul> <li><a href="qabstractstate-members.html">List of all members, including inherited members</a></li> </ul> <hr /> <a name="public-functions"></a> <h2>Public Functions</h2> <table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qabstractstate.html#dtor.QAbstractState">~QAbstractState</a></b> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QStateMachine * </td><td class="memItemRight" valign="bottom"><b><a href="qabstractstate.html#machine">machine</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QState * </td><td class="memItemRight" valign="bottom"><b><a href="qabstractstate.html#parentState">parentState</a></b> () const</td></tr> </table> <ul> <li><div bar="2" class="fn"></div>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li> </ul> <hr /> <a name="signals"></a> <h2>Signals</h2> <table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qabstractstate.html#entered">entered</a></b> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qabstractstate.html#exited">exited</a></b> ()</td></tr> </table> <ul> <li><div bar="2" class="fn"></div>1 signal inherited from <a href="qobject.html#signals">QObject</a></li> </ul> <hr /> <a name="protected-functions"></a> <h2>Protected Functions</h2> <table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qabstractstate.html#QAbstractState">QAbstractState</a></b> ( QState * <i>parent</i> = 0 )</td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qabstractstate.html#onEntry">onEntry</a></b> ( QEvent * <i>event</i> ) = 0</td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qabstractstate.html#onExit">onExit</a></b> ( QEvent * <i>event</i> ) = 0</td></tr> </table> <hr /> <a name="reimplemented-protected-functions"></a> <h2>Reimplemented Protected Functions</h2> <table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><b><a href="qabstractstate.html#event">event</a></b> ( QEvent * <i>e</i> )</td></tr> </table> <ul> <li><div bar="2" class="fn"></div>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li> </ul> <h3>Additional Inherited Members</h3> <ul> <li><div class="fn"></div>1 property inherited from <a href="qobject.html#properties">QObject</a></li> <li><div class="fn"></div>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li> <li><div class="fn"></div>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li> </ul> <a name="details"></a> <hr /> <h2>Detailed Description</h2> <p>The QAbstractState class is the base class of states of a <a href="qstatemachine.html">QStateMachine</a>.</p> <p>The QAbstractState class is the abstract base class of states that are part of a <a href="qstatemachine.html">QStateMachine</a>. It defines the interface that all state objects have in common. QAbstractState is part of <a href="statemachine-api.html">The State Machine Framework</a>.</p> <p>The <a href="qabstractstate.html#entered">entered</a>() signal is emitted when the state has been entered. The <a href="qabstractstate.html#exited">exited</a>() signal is emitted when the state has been exited.</p> <p>The <a href="qabstractstate.html#parentState">parentState</a>() function returns the state's parent state. The <a href="qabstractstate.html#machine">machine</a>() function returns the state machine that the state is part of.</p> <a name="subclassing"></a> <h3>Subclassing</h3> <p>The <a href="qabstractstate.html#onEntry">onEntry</a>() function is called when the state is entered; reimplement this function to perform custom processing when the state is entered.</p> <p>The <a href="qabstractstate.html#onExit">onExit</a>() function is called when the state is exited; reimplement this function to perform custom processing when the state is exited.</p> <hr /> <h2>Member Function Documentation</h2> <a name="//apple_ref/cpp/instm/QAbstractState/QAbstractState"></a> <h3 class="fn"><a name="QAbstractState"></a>QAbstractState::QAbstractState ( <a href="qstate.html">QState</a> * <i>parent</i> = 0 ) <tt> [protected]</tt></h3> <p>Constructs a new state with the given <i>parent</i> state.</p> <a name="//apple_ref/cpp/instm/QAbstractState/~QAbstractState"></a> <h3 class="fn"><a name="dtor.QAbstractState"></a>QAbstractState::~QAbstractState ()</h3> <p>Destroys this state.</p> <a name="//apple_ref/cpp/instm/QAbstractState/entered"></a> <h3 class="fn"><a name="entered"></a>void QAbstractState::entered () <tt> [signal]</tt></h3> <p>This signal is emitted when the state has been entered (after <a href="qabstractstate.html#onEntry">onEntry</a>() has been called).</p> <a name="//apple_ref/cpp/instm/QAbstractState/event"></a> <h3 class="fn"><a name="event"></a>bool QAbstractState::event ( <a href="qevent.html">QEvent</a> * <i>e</i> ) <tt> [virtual protected]</tt></h3> <p>Reimplemented from <a href="qobject.html#event">QObject::event</a>().</p> <a name="//apple_ref/cpp/instm/QAbstractState/exited"></a> <h3 class="fn"><a name="exited"></a>void QAbstractState::exited () <tt> [signal]</tt></h3> <p>This signal is emitted when the state has been exited (after <a href="qabstractstate.html#onExit">onExit</a>() has been called).</p> <a name="//apple_ref/cpp/instm/QAbstractState/machine"></a> <h3 class="fn"><a name="machine"></a><a href="qstatemachine.html">QStateMachine</a> * QAbstractState::machine () const</h3> <p>Returns the state machine that this state is part of, or 0 if the state is not part of a state machine.</p> <a name="//apple_ref/cpp/instm/QAbstractState/onEntry"></a> <h3 class="fn"><a name="onEntry"></a>void QAbstractState::onEntry ( <a href="qevent.html">QEvent</a> * <i>event</i> ) <tt> [pure virtual protected]</tt></h3> <p>This function is called when the state is entered. The given <i>event</i> is what caused the state to be entered. Reimplement this function to perform custom processing when the state is entered.</p> <a name="//apple_ref/cpp/instm/QAbstractState/onExit"></a> <h3 class="fn"><a name="onExit"></a>void QAbstractState::onExit ( <a href="qevent.html">QEvent</a> * <i>event</i> ) <tt> [pure virtual protected]</tt></h3> <p>This function is called when the state is exited. The given <i>event</i> is what caused the state to be exited. Reimplement this function to perform custom processing when the state is exited.</p> <a name="//apple_ref/cpp/instm/QAbstractState/parentState"></a> <h3 class="fn"><a name="parentState"></a><a href="qstate.html">QState</a> * QAbstractState::parentState () const</h3> <p>Returns this state's parent state, or 0 if the state has no parent state.</p> <p /><address><hr /><div align="center"> <table width="100%" cellspacing="0" border="0"><tr class="address"> <td width="40%" align="left">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)</td> <td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td> <td width="40%" align="right"><div align="right">Qt 4.6.3</div></td> </tr></table></div></address></body> </html>