Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > ff187cb994c94c614ecc64c5a8528b1b > files > 6876

qt-doc-4.8.5-10.fc18.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" />
<!-- qtimer.cpp -->
  <title>Qt 4.8: QTimer 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>QTimer</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="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#accuracy-and-timer-resolution">Accuracy and Timer Resolution</a></li>
<li class="level2"><a href="#alternatives-to-qtimer">Alternatives to QTimer</a></li>
</ul>
</div>
<h1 class="title">QTimer Class Reference</h1>
<!-- $$$QTimer-brief -->
<p>The QTimer class provides repetitive and single-shot timers. <a href="#details">More...</a></p>
<!-- @@@QTimer -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QTimer&gt;</span></pre><p><b>Inherits: </b><a href="qobject.html">QObject</a>.</p>
<ul>
<li><a href="qtimer-members.html">List of all members, including inherited members</a></li>
<li><a href="qtimer-qt3.html">Qt 3 support members</a></li>
</ul>
<a name="properties"></a>
<h2>Properties</h2>
<ul>
<li class="fn"><b><a href="qtimer.html#active-prop">active</a></b> : const bool</li>
<li class="fn"><b><a href="qtimer.html#interval-prop">interval</a></b> : int</li>
<li class="fn"><b><a href="qtimer.html#singleShot-prop">singleShot</a></b> : bool</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="qtimer.html#QTimer">QTimer</a></b> ( QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtimer.html#dtor.QTimer">~QTimer</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtimer.html#interval-prop">interval</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtimer.html#active-prop">isActive</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtimer.html#singleShot-prop">isSingleShot</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtimer.html#interval-prop">setInterval</a></b> ( int <i>msec</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtimer.html#singleShot-prop">setSingleShot</a></b> ( bool <i>singleShot</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtimer.html#timerId">timerId</a></b> () const</td></tr>
</table>
<ul>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
</ul>
<a name="public-slots"></a>
<h2>Public Slots</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtimer.html#start">start</a></b> ( int <i>msec</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtimer.html#start-2">start</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtimer.html#stop">stop</a></b> ()</td></tr>
</table>
<ul>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtimer.html#timeout">timeout</a></b> ()</td></tr>
</table>
<ul>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtimer.html#singleShot">singleShot</a></b> ( int <i>msec</i>, QObject * <i>receiver</i>, const char * <i>member</i> )</td></tr>
</table>
<ul>
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">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 void </td><td class="memItemRight bottomAlign"><b><a href="qtimer.html#timerEvent">timerEvent</a></b> ( QTimerEvent * <i>e</i> )</td></tr>
</table>
<ul>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QTimer-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QTimer class provides repetitive and single-shot timers.</p>
<p>The QTimer class provides a high-level programming interface for timers. To use it, create a QTimer, connect its <a href="qtimer.html#timeout">timeout</a>() signal to the appropriate slots, and call <a href="qtimer.html#start">start</a>(). From then on it will emit the <a href="qtimer.html#timeout">timeout</a>() signal at constant intervals.</p>
<p>Example for a one second (1000 millisecond) timer (from the <a href="widgets-analogclock.html">Analog Clock</a> example):</p>
<pre class="cpp">     <span class="type">QTimer</span> <span class="operator">*</span>timer <span class="operator">=</span> <span class="keyword">new</span> <span class="type">QTimer</span>(<span class="keyword">this</span>);
     connect(timer<span class="operator">,</span> SIGNAL(timeout())<span class="operator">,</span> <span class="keyword">this</span><span class="operator">,</span> SLOT(update()));
     timer<span class="operator">-</span><span class="operator">&gt;</span>start(<span class="number">1000</span>);</pre>
<p>From then on, the <tt>update()</tt> slot is called every second.</p>
<p>You can set a timer to time out only once by calling setSingleShot(true). You can also use the static <a href="qtimer.html#singleShot">QTimer::singleShot</a>() function to call a slot after a specified interval:</p>
<pre class="cpp">     <span class="type">QTimer</span><span class="operator">::</span>singleShot(<span class="number">200</span><span class="operator">,</span> <span class="keyword">this</span><span class="operator">,</span> SLOT(updateCaption()));</pre>
<p>In multithreaded applications, you can use QTimer in any thread that has an event loop. To start an event loop from a non-GUI thread, use <a href="qthread.html#exec">QThread::exec</a>(). Qt uses the timer's <a href="qobject.html#thread">thread affinity</a> to determine which thread will emit the <a href="qtimer.html#timeout">timeout()</a> signal. Because of this, you must start and stop the timer in its thread; it is not possible to start a timer from another thread.</p>
<p>As a special case, a QTimer with a timeout of 0 will time out as soon as all the events in the window system's event queue have been processed. This can be used to do heavy work while providing a snappy user interface:</p>
<pre class="cpp">     <span class="type">QTimer</span> <span class="operator">*</span>timer <span class="operator">=</span> <span class="keyword">new</span> <span class="type">QTimer</span>(<span class="keyword">this</span>);
     connect(timer<span class="operator">,</span> SIGNAL(timeout())<span class="operator">,</span> <span class="keyword">this</span><span class="operator">,</span> SLOT(processOneThing()));
     timer<span class="operator">-</span><span class="operator">&gt;</span>start();</pre>
<p><tt>processOneThing()</tt> will from then on be called repeatedly. It should be written in such a way that it always returns quickly (typically after processing one data item) so that Qt can deliver events to widgets and stop the timer as soon as it has done all its work. This is the traditional way of implementing heavy work in GUI applications; multithreading is now becoming available on more and more platforms, and we expect that zero-millisecond QTimers will gradually be replaced by <a href="qthread.html">QThread</a>s.</p>
<a name="accuracy-and-timer-resolution"></a>
<h3>Accuracy and Timer Resolution</h3>
<p>Timers will never time out earlier than the specified timeout value and they are not guaranteed to time out at the exact value specified. In many situations, they may time out late by a period of time that depends on the accuracy of the system timers.</p>
<p>The accuracy of timers depends on the underlying operating system and hardware. Most platforms support a resolution of 1 millisecond, though the accuracy of the timer will not equal this resolution in many real-world situations.</p>
<p>If Qt is unable to deliver the requested number of timer clicks, it will silently discard some.</p>
<a name="alternatives-to-qtimer"></a>
<h3>Alternatives to QTimer</h3>
<p>An alternative to using QTimer is to call <a href="qobject.html#startTimer">QObject::startTimer</a>() for your object and reimplement the <a href="qobject.html#timerEvent">QObject::timerEvent</a>() event handler in your class (which must inherit <a href="qobject.html">QObject</a>). The disadvantage is that <a href="qtimer.html#timerEvent">timerEvent</a>() does not support such high-level features as single-shot timers or signals.</p>
<p>Another alternative to using QTimer is to use <a href="qbasictimer.html">QBasicTimer</a>. It is typically less cumbersome than using <a href="qobject.html#startTimer">QObject::startTimer</a>() directly. See <a href="timers.html">Timers</a> for an overview of all three approaches.</p>
<p>Some operating systems limit the number of timers that may be used; Qt tries to work around these limitations.</p>
</div>
<p><b>See also </b><a href="qbasictimer.html">QBasicTimer</a>, <a href="qtimerevent.html">QTimerEvent</a>, <a href="qobject.html#timerEvent">QObject::timerEvent</a>(), <a href="timers.html">Timers</a>, <a href="widgets-analogclock.html">Analog Clock Example</a>, and <a href="widgets-wiggly.html">Wiggly Example</a>.</p>
<!-- @@@QTimer -->
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$active-prop$$$isActive -->
<h3 class="fn"><a name="active-prop"></a><span class="name">active</span> : const <span class="type">bool</span></h3>
<p>This boolean property is true if the timer is running; otherwise false.</p>
<p>This property was introduced in Qt 4.3.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isActive</b></span> () const</td></tr>
</table>
<!-- @@@active -->
<!-- $$$interval-prop$$$interval$$$setIntervalint -->
<h3 class="fn"><a name="interval-prop"></a><span class="name">interval</span> : <span class="type">int</span></h3>
<p>This property holds the timeout interval in milliseconds.</p>
<p>The default value for this property is 0. A <a href="qtimer.html">QTimer</a> with a timeout interval of 0 will time out as soon as all the events in the window system's event queue have been processed.</p>
<p>Setting the interval of an active timer changes its <a href="qtimer.html#timerId">timerId</a>().</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>interval</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setInterval</b></span> ( int <i>msec</i> )</td></tr>
</table>
<p><b>See also </b><a href="qtimer.html#singleShot-prop">singleShot</a>.</p>
<!-- @@@interval -->
<!-- $$$singleShot-prop$$$isSingleShot$$$setSingleShotbool -->
<h3 class="fn"><a name="singleShot-prop"></a><span class="name">singleShot</span> : <span class="type">bool</span></h3>
<p>This property holds whether the timer is a single-shot timer.</p>
<p>A single-shot timer fires only once, non-single-shot timers fire every <a href="qtimer.html#interval-prop">interval</a> milliseconds.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isSingleShot</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setSingleShot</b></span> ( bool <i>singleShot</i> )</td></tr>
</table>
<p><b>See also </b><a href="qtimer.html#interval-prop">interval</a> and <a href="qtimer.html#singleShot">singleShot</a>().</p>
<!-- @@@singleShot -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QTimer[overload1]$$$QTimerQObject* -->
<h3 class="fn"><a name="QTimer"></a>QTimer::<span class="name">QTimer</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
<p>Constructs a timer with the given <i>parent</i>.</p>
<!-- @@@QTimer -->
<!-- $$$~QTimer[overload1]$$$~QTimer -->
<h3 class="fn"><a name="dtor.QTimer"></a>QTimer::<span class="name">~QTimer</span> ()</h3>
<p>Destroys the timer.</p>
<!-- @@@~QTimer -->
<!-- $$$singleShot[overload1]$$$singleShotintQObject*constchar* -->
<h3 class="fn"><a name="singleShot"></a><span class="type">void</span> QTimer::<span class="name">singleShot</span> ( <span class="type">int</span> <i>msec</i>, <span class="type"><a href="qobject.html">QObject</a></span> * <i>receiver</i>, const <span class="type">char</span> * <i>member</i> )<tt> [static]</tt></h3>
<p>This static function calls a slot after a given time interval.</p>
<p>It is very convenient to use this function because you do not need to bother with a <a href="qobject.html#timerEvent">timerEvent</a> or create a local <a href="qtimer.html">QTimer</a> object.</p>
<p>Example:</p>
<pre class="cpp"> <span class="preprocessor">#include &lt;QApplication&gt;</span>
 <span class="preprocessor">#include &lt;QTimer&gt;</span>

 <span class="type">int</span> main(<span class="type">int</span> argc<span class="operator">,</span> <span class="type">char</span> <span class="operator">*</span>argv<span class="operator">[</span><span class="operator">]</span>)
 {
     <span class="type"><a href="qapplication.html">QApplication</a></span> app(argc<span class="operator">,</span> argv);
     <span class="type"><a href="qtimer.html">QTimer</a></span><span class="operator">::</span>singleShot(<span class="number">600000</span><span class="operator">,</span> <span class="operator">&amp;</span>app<span class="operator">,</span> SLOT(quit()));
     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
     <span class="keyword">return</span> app<span class="operator">.</span>exec();
 }</pre>
<p>This sample program automatically terminates after 10 minutes (600,000 milliseconds).</p>
<p>The <i>receiver</i> is the receiving object and the <i>member</i> is the slot. The time interval is <i>msec</i> milliseconds.</p>
<p><b>Note:</b> This function is <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p>
<p><b>See also </b><a href="qtimer.html#singleShot-prop">setSingleShot</a>() and <a href="qtimer.html#start">start</a>().</p>
<!-- @@@singleShot -->
<!-- $$$start[overload1]$$$startint -->
<h3 class="fn"><a name="start"></a><span class="type">void</span> QTimer::<span class="name">start</span> ( <span class="type">int</span> <i>msec</i> )<tt> [slot]</tt></h3>
<p>Starts or restarts the timer with a timeout interval of <i>msec</i> milliseconds.</p>
<p>If the timer is already running, it will be <a href="qtimer.html#stop">stopped</a> and restarted.</p>
<p>If <a href="qtimer.html#singleShot-prop">singleShot</a> is true, the timer will be activated only once.</p>
<!-- @@@start -->
<!-- $$$start$$$start -->
<h3 class="fn"><a name="start-2"></a><span class="type">void</span> QTimer::<span class="name">start</span> ()<tt> [slot]</tt></h3>
<p>This function overloads <a href="qtimer.html#start">start</a>().</p>
<p>Starts or restarts the timer with the timeout specified in <a href="qtimer.html#interval-prop">interval</a>.</p>
<p>If the timer is already running, it will be <a href="qtimer.html#stop">stopped</a> and restarted.</p>
<p>If <a href="qtimer.html#singleShot-prop">singleShot</a> is true, the timer will be activated only once.</p>
<!-- @@@start -->
<!-- $$$stop[overload1]$$$stop -->
<h3 class="fn"><a name="stop"></a><span class="type">void</span> QTimer::<span class="name">stop</span> ()<tt> [slot]</tt></h3>
<p>Stops the timer.</p>
<p><b>See also </b><a href="qtimer.html#start">start</a>().</p>
<!-- @@@stop -->
<!-- $$$timeout[overload1]$$$timeout -->
<h3 class="fn"><a name="timeout"></a><span class="type">void</span> QTimer::<span class="name">timeout</span> ()<tt> [signal]</tt></h3>
<p>This signal is emitted when the timer times out.</p>
<p><b>See also </b><a href="qtimer.html#interval-prop">interval</a>, <a href="qtimer.html#start">start</a>(), and <a href="qtimer.html#stop">stop</a>().</p>
<!-- @@@timeout -->
<!-- $$$timerEvent[overload1]$$$timerEventQTimerEvent* -->
<h3 class="fn"><a name="timerEvent"></a><span class="type">void</span> QTimer::<span class="name">timerEvent</span> ( <span class="type"><a href="qtimerevent.html">QTimerEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qobject.html#timerEvent">QObject::timerEvent</a>().</p>
<!-- @@@timerEvent -->
<!-- $$$timerId[overload1]$$$timerId -->
<h3 class="fn"><a name="timerId"></a><span class="type">int</span> QTimer::<span class="name">timerId</span> () const</h3>
<p>Returns the ID of the timer if the timer is running; otherwise returns -1.</p>
<!-- @@@timerId -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2013 Digia Plc and/or its
      subsidiaries. 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>
      Digia, Qt and their respective logos are trademarks of Digia Plc 
      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>