Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 5518

qt4-doc-4.8.7-26.2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qhistorystate.cpp -->
  <title>Qt 4.8: QHistoryState Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtcore.html">QtCore</a></li>
<li>QHistoryState</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QHistoryState Class Reference</h1>
<!-- $$$QHistoryState-brief -->
<p>The QHistoryState class provides a means of returning to a previously active substate. <a href="#details">More...</a></p>
<!-- @@@QHistoryState -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QHistoryState&gt;</span></pre><p><b>Inherits: </b><a href="qabstractstate.html">QAbstractState</a>.</p>
<p>This class was introduced in Qt 4.6.</p>
<ul>
<li><a href="qhistorystate-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qhistorystate.html#HistoryType-enum">HistoryType</a></b> { ShallowHistory, DeepHistory }</td></tr>
</table>
<a name="properties"></a>
<h2>Properties</h2>
<ul>
<li class="fn"><b><a href="qhistorystate.html#defaultState-prop">defaultState</a></b> : QAbstractState *</li>
<li class="fn"><b><a href="qhistorystate.html#historyType-prop">historyType</a></b> : HistoryType</li>
</ul>
<ul>
<li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qhistorystate.html#QHistoryState">QHistoryState</a></b> ( QState * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qhistorystate.html#QHistoryState-2">QHistoryState</a></b> ( HistoryType <i>type</i>, QState * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qhistorystate.html#dtor.QHistoryState">~QHistoryState</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAbstractState * </td><td class="memItemRight bottomAlign"><b><a href="qhistorystate.html#defaultState-prop">defaultState</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> HistoryType </td><td class="memItemRight bottomAlign"><b><a href="qhistorystate.html#historyType-prop">historyType</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qhistorystate.html#defaultState-prop">setDefaultState</a></b> ( QAbstractState * <i>state</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qhistorystate.html#historyType-prop">setHistoryType</a></b> ( HistoryType <i>type</i> )</td></tr>
</table>
<ul>
<li class="fn">2 public functions inherited from <a href="qabstractstate.html#public-functions">QAbstractState</a></li>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
</ul>
<a name="reimplemented-protected-functions"></a>
<h2>Reimplemented Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qhistorystate.html#event">event</a></b> ( QEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qhistorystate.html#onEntry">onEntry</a></b> ( QEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qhistorystate.html#onExit">onExit</a></b> ( QEvent * <i>event</i> )</td></tr>
</table>
<ul>
<li class="fn">3 protected functions inherited from <a href="qabstractstate.html#protected-functions">QAbstractState</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
<li class="fn">2 signals inherited from <a href="qabstractstate.html#signals">QAbstractState</a></li>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li class="fn">3 protected functions inherited from <a href="qabstractstate.html#protected-functions">QAbstractState</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QHistoryState-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QHistoryState class provides a means of returning to a previously active substate.</p>
<p>A history state is a pseudo-state that represents the child state that the parent state was in the last time the parent state was exited. A transition with a history state as its target is in fact a transition to one of the other child states of the parent state. QHistoryState is part of <a href="statemachine-api.html">The State Machine Framework</a>.</p>
<p>Use the <a href="qhistorystate.html#defaultState-prop">setDefaultState</a>() function to set the state that should be entered if the parent state has never been entered. Example:</p>
<pre class="cpp"> <span class="type"><a href="qstatemachine.html">QStateMachine</a></span> machine;

 <span class="type"><a href="qstate.html">QState</a></span> <span class="operator">*</span>s1 <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qstate.html">QState</a></span>();
 <span class="type"><a href="qstate.html">QState</a></span> <span class="operator">*</span>s11 <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qstate.html">QState</a></span>(s1);
 <span class="type"><a href="qstate.html">QState</a></span> <span class="operator">*</span>s12 <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qstate.html">QState</a></span>(s1);

 <span class="type">QHistoryState</span> <span class="operator">*</span>s1h <span class="operator">=</span> <span class="keyword">new</span> <span class="type">QHistoryState</span>(s1);
 s1h<span class="operator">-</span><span class="operator">&gt;</span><a href="qhistorystate.html#defaultState-prop">setDefaultState</a>(s11);

 machine<span class="operator">.</span>addState(s1);

 <span class="type"><a href="qstate.html">QState</a></span> <span class="operator">*</span>s2 <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qstate.html">QState</a></span>();
 machine<span class="operator">.</span>addState(s2);

 <span class="type"><a href="qpushbutton.html">QPushButton</a></span> <span class="operator">*</span>button <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qpushbutton.html">QPushButton</a></span>();
 <span class="comment">// Clicking the button will cause the state machine to enter the child state</span>
 <span class="comment">// that s1 was in the last time s1 was exited, or the history state's default</span>
 <span class="comment">// state if s1 has never been entered.</span>
 s1<span class="operator">-</span><span class="operator">&gt;</span>addTransition(button<span class="operator">,</span> SIGNAL(clicked())<span class="operator">,</span> s1h);</pre>
<p>By default a history state is shallow, meaning that it won't remember nested states. This can be configured through the <a href="qhistorystate.html#historyType-prop">historyType</a> property.</p>
</div>
<!-- @@@QHistoryState -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$HistoryType$$$ShallowHistory$$$DeepHistory -->
<h3 class="fn"><a name="HistoryType-enum"></a>enum QHistoryState::<span class="name">HistoryType</span></h3>
<p>This enum specifies the type of history that a <a href="qhistorystate.html">QHistoryState</a> records.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QHistoryState::ShallowHistory</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">Only the immediate child states of the parent state are recorded. In this case a transition with the history state as its target will end up in the immediate child state that the parent was in the last time it was exited. This is the default.</td></tr>
<tr><td class="topAlign"><tt>QHistoryState::DeepHistory</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">Nested states are recorded. In this case a transition with the history state as its target will end up in the most deeply nested descendant state the parent was in the last time it was exited.</td></tr>
</table>
<!-- @@@HistoryType -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$defaultState-prop$$$defaultState$$$setDefaultStateQAbstractState* -->
<h3 class="fn"><a name="defaultState-prop"></a><span class="name">defaultState</span> : <span class="type"><a href="qabstractstate.html">QAbstractState</a></span> *</h3>
<p>This property holds the default state of this history state.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QAbstractState * </td><td class="memItemRight bottomAlign"><span class="name"><b>defaultState</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setDefaultState</b></span> ( QAbstractState * <i>state</i> )</td></tr>
</table>
<!-- @@@defaultState -->
<!-- $$$historyType-prop$$$historyType$$$setHistoryTypeHistoryType -->
<h3 class="fn"><a name="historyType-prop"></a><span class="name">historyType</span> : <span class="type"><a href="qhistorystate.html#HistoryType-enum">HistoryType</a></span></h3>
<p>This property holds the type of history that this history state records.</p>
<p>The default value of this property is <a href="qhistorystate.html#HistoryType-enum">QHistoryState::ShallowHistory</a>.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> HistoryType </td><td class="memItemRight bottomAlign"><span class="name"><b>historyType</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setHistoryType</b></span> ( HistoryType <i>type</i> )</td></tr>
</table>
<!-- @@@historyType -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QHistoryState[overload1]$$$QHistoryStateQState* -->
<h3 class="fn"><a name="QHistoryState"></a>QHistoryState::<span class="name">QHistoryState</span> ( <span class="type"><a href="qstate.html">QState</a></span> * <i>parent</i> = 0 )</h3>
<p>Constructs a new shallow history state with the given <i>parent</i> state.</p>
<!-- @@@QHistoryState -->
<!-- $$$QHistoryState$$$QHistoryStateHistoryTypeQState* -->
<h3 class="fn"><a name="QHistoryState-2"></a>QHistoryState::<span class="name">QHistoryState</span> ( <span class="type"><a href="qhistorystate.html#HistoryType-enum">HistoryType</a></span> <i>type</i>, <span class="type"><a href="qstate.html">QState</a></span> * <i>parent</i> = 0 )</h3>
<p>Constructs a new history state of the given <i>type</i>, with the given <i>parent</i> state.</p>
<!-- @@@QHistoryState -->
<!-- $$$~QHistoryState[overload1]$$$~QHistoryState -->
<h3 class="fn"><a name="dtor.QHistoryState"></a>QHistoryState::<span class="name">~QHistoryState</span> ()</h3>
<p>Destroys this history state.</p>
<!-- @@@~QHistoryState -->
<!-- $$$event[overload1]$$$eventQEvent* -->
<h3 class="fn"><a name="event"></a><span class="type">bool</span> QHistoryState::<span class="name">event</span> ( <span class="type"><a href="qevent.html">QEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qobject.html#event">QObject::event</a>().</p>
<!-- @@@event -->
<!-- $$$onEntry[overload1]$$$onEntryQEvent* -->
<h3 class="fn"><a name="onEntry"></a><span class="type">void</span> QHistoryState::<span class="name">onEntry</span> ( <span class="type"><a href="qevent.html">QEvent</a></span> * <i>event</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qabstractstate.html#onEntry">QAbstractState::onEntry</a>().</p>
<!-- @@@onEntry -->
<!-- $$$onExit[overload1]$$$onExitQEvent* -->
<h3 class="fn"><a name="onExit"></a><span class="type">void</span> QHistoryState::<span class="name">onExit</span> ( <span class="type"><a href="qevent.html">QEvent</a></span> * <i>event</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qabstractstate.html#onExit">QAbstractState::onExit</a>().</p>
<!-- @@@onExit -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2015 The Qt Company Ltd.
      Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Qt and respective logos are trademarks of The Qt Company Ltd 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>