Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > a6711891ce757817bba854bf3f25205a > files > 2340

qtjambi-doc-4.3.3-3mdv2008.1.i586.rpm

<class name="QTimer" doc="/**
&lt;p&gt;The &lt;a href=&quot;QTimer.html#QTimer(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QTimer&lt;/tt&gt;&lt;/a&gt; class provides repetitive and single-shot timers.&lt;/p&gt;
&lt;p&gt;The &lt;a href=&quot;QTimer.html#QTimer(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QTimer&lt;/tt&gt;&lt;/a&gt; class provides a high-level programming interface for timers. To use it, create a &lt;a href=&quot;QTimer.html#QTimer(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QTimer&lt;/tt&gt;&lt;/a&gt;, connect its &lt;a href=&quot;QTimer.html#timeout()&quot;&gt;&lt;tt&gt;timeout&lt;/tt&gt;&lt;/a&gt; signal to the appropriate slots, and call &lt;a href=&quot;QTimer.html#start()&quot;&gt;&lt;tt&gt;start&lt;/tt&gt;&lt;/a&gt;. From then on it will emit the &lt;a href=&quot;QTimer.html#timeout()&quot;&gt;&lt;tt&gt;timeout&lt;/tt&gt;&lt;/a&gt; signal at constant intervals.&lt;/p&gt;
&lt;p&gt;Example for a one second (1000 millisecond) timer (from the Analog Clock&lt;/tt&gt; example):&lt;/p&gt;
&lt;pre&gt;        QTimer *timer = new QTimer(this);
        connect(timer, SIGNAL(timeout()), this, SLOT(update()));
        timer-&amp;gt;start(1000);&lt;/pre&gt;
&lt;p&gt;From then on, the &lt;tt&gt;update()&lt;/tt&gt; slot is called every second.&lt;/p&gt;
&lt;p&gt;You can set a timer to time out only once by calling &lt;a href=&quot;QTimer.html#setSingleShot(boolean)&quot;&gt;&lt;tt&gt;setSingleShot&lt;/tt&gt;&lt;/a&gt;(true). You can also use the static QTimer::singleShot() function to call a slot after a specified interval:&lt;/p&gt;
&lt;pre&gt;        QTimer::singleShot(200, this, SLOT(updateCaption()));&lt;/pre&gt;
&lt;p&gt;In multithreaded applications, you can use &lt;a href=&quot;QTimer.html#QTimer(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QTimer&lt;/tt&gt;&lt;/a&gt; in any thread that has an event loop. To start an event loop from a non-GUI thread, use QThread::exec(). Qt uses the the timer's thread affinity&lt;/tt&gt; to determine which thread will emit the timeout() 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.&lt;/p&gt;
&lt;p&gt;As a special case, a &lt;a href=&quot;QTimer.html#QTimer(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QTimer&lt;/tt&gt;&lt;/a&gt; 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:&lt;/p&gt;
&lt;pre&gt;        QTimer *timer = new QTimer(this);
        connect(timer, SIGNAL(timeout()), this, SLOT(processOneThing()));
        timer-&amp;gt;start();&lt;/pre&gt;
&lt;p&gt;&lt;tt&gt;processOneThing()&lt;/tt&gt; 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 &lt;tt&gt;QThread&lt;/tt&gt;s.&lt;/p&gt;
&lt;p&gt;Note that &lt;a href=&quot;QTimer.html#QTimer(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QTimer&lt;/tt&gt;&lt;/a&gt;'s accuracy depends on the underlying operating system and hardware. Most platforms support an accuracy of 1 millisecond, but Windows 98 supports only 55. If Qt is unable to deliver the requested number of timer clicks, it will silently discard some.&lt;/p&gt;
&lt;p&gt;An alternative to using &lt;a href=&quot;QTimer.html#QTimer(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QTimer&lt;/tt&gt;&lt;/a&gt; is to call QObject::startTimer() for your object and reimplement the QObject::timerEvent() event handler in your class (which must inherit &lt;a href=&quot;QObject.html#QObject(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QObject&lt;/tt&gt;&lt;/a&gt;). The disadvantage is that &lt;a href=&quot;QTimer.html#timerEvent(com.trolltech.qt.core.QTimerEvent)&quot;&gt;&lt;tt&gt;timerEvent&lt;/tt&gt;&lt;/a&gt; does not support such high-level features as single-shot timers or signals.&lt;/p&gt;
&lt;p&gt;Another alternative to using &lt;a href=&quot;QTimer.html#QTimer(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QTimer&lt;/tt&gt;&lt;/a&gt; is to use &lt;a href=&quot;QBasicTimer.html&quot;&gt;&lt;tt&gt;QBasicTimer&lt;/tt&gt;&lt;/a&gt;. It is typically less cumbersome than using QObject::startTimer() directly. See &lt;a href=&quot;%2E%2E/timers.html&quot;&gt;Timers&lt;/tt&gt;&lt;/a&gt; for an overview of all three approaches.&lt;/p&gt;
&lt;p&gt;Some operating systems limit the number of timers that may be used; Qt tries to work around these limitations.&lt;/p&gt;

@see &lt;a href=&quot;QBasicTimer.html&quot;&gt;&lt;tt&gt;QBasicTimer&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QTimerEvent.html&quot;&gt;&lt;tt&gt;QTimerEvent&lt;/tt&gt;&lt;/a&gt;
@see &lt;tt&gt;QObject::timerEvent&lt;/tt&gt;
@see &lt;a href=&quot;%2E%2E/timers.html&quot;&gt;Timers&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;%2E%2E/qtjambi-analogclock.html&quot;&gt;Analog Clock Example&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;%2E%2E/qtjambi-wiggly.html&quot;&gt;Wiggly Example&lt;/tt&gt;&lt;/a&gt; */">
    <signal name="protected final void timeout()" doc="/**
&lt;p&gt;This signal is emitted when the timer times out.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signature:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;QTimer.html#interval()&quot;&gt;interval&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QTimer.html#start()&quot;&gt;&lt;tt&gt;start&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QTimer.html#stop()&quot;&gt;&lt;tt&gt;stop&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <method name="public QTimer(com.trolltech.qt.core.QObject parent)" doc="/**
&lt;p&gt;Constructs a timer with the given &lt;tt&gt;parent&lt;/tt&gt;.&lt;/p&gt;
 */"/>
    <method name="public QTimer()" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QTimer.html#QTimer(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QTimer&lt;/tt&gt;&lt;/a&gt;(0). */"/>
    <method name="public final int interval()" doc="/**
&lt;p&gt;Returns the timeout interval in milliseconds.&lt;/p&gt;
&lt;p&gt;The default value for this property is 0. A &lt;a href=&quot;QTimer.html#QTimer(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QTimer&lt;/tt&gt;&lt;/a&gt; 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.&lt;/p&gt;
&lt;p&gt;Setting the interval of an active timer changes its &lt;a href=&quot;QTimer.html#timerId()&quot;&gt;&lt;tt&gt;timerId&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QTimer.html#setInterval(int)&quot;&gt;&lt;tt&gt;setInterval&lt;/tt&gt;&lt;/a&gt;
@see &lt;tt&gt;singleShot&lt;/tt&gt; */"/>
    <method name="public final boolean isActive()" doc="/**
&lt;p&gt;This boolean property is true if the timer is running; otherwise false.&lt;/p&gt;
 */"/>
    <method name="public final boolean isSingleShot()" doc="/**
&lt;p&gt;Returns whether the timer is a single-shot timer.&lt;/p&gt;
&lt;p&gt;A single-shot timer fires only once, non-single-shot timers fire every &lt;a href=&quot;QTimer.html#interval()&quot;&gt;interval&lt;/tt&gt;&lt;/a&gt; milliseconds.&lt;/p&gt;

@see &lt;a href=&quot;QTimer.html#interval()&quot;&gt;interval&lt;/tt&gt;&lt;/a&gt;
@see &lt;tt&gt;singleShot&lt;/tt&gt; */"/>
    <method name="public final void setInterval(int msec)" doc="/**
&lt;p&gt;Sets the timeout interval in milliseconds to &lt;tt&gt;msec&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;The default value for this property is 0. A &lt;a href=&quot;QTimer.html#QTimer(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QTimer&lt;/tt&gt;&lt;/a&gt; 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.&lt;/p&gt;
&lt;p&gt;Setting the interval of an active timer changes its &lt;a href=&quot;QTimer.html#timerId()&quot;&gt;&lt;tt&gt;timerId&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QTimer.html#interval()&quot;&gt;&lt;tt&gt;interval&lt;/tt&gt;&lt;/a&gt;
@see &lt;tt&gt;singleShot&lt;/tt&gt; */"/>
    <method name="public final void setSingleShot(boolean singleShot)" doc="/**
&lt;p&gt;Sets whether the timer is a single-shot timer to &lt;tt&gt;singleShot&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;A single-shot timer fires only once, non-single-shot timers fire every &lt;a href=&quot;QTimer.html#interval()&quot;&gt;interval&lt;/tt&gt;&lt;/a&gt; milliseconds.&lt;/p&gt;

@see &lt;a href=&quot;QTimer.html#isSingleShot()&quot;&gt;&lt;tt&gt;isSingleShot&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QTimer.html#interval()&quot;&gt;interval&lt;/tt&gt;&lt;/a&gt;
@see &lt;tt&gt;singleShot&lt;/tt&gt; */"/>
    <method name="public final void start(int msec)" doc="/**
&lt;p&gt;Starts or restarts the timer with a timeout interval of &lt;tt&gt;msec&lt;/tt&gt; milliseconds.&lt;/p&gt;
 */"/>
    <method name="public final void start()" doc="/**
&lt;p&gt;Starts or restarts the timer with the timeout specified in &lt;a href=&quot;QTimer.html#interval()&quot;&gt;interval&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If &lt;tt&gt;singleShot&lt;/tt&gt; is true, the timer will be activated only once.&lt;/p&gt;
 */"/>
    <method name="public final void stop()" doc="/**
&lt;p&gt;Stops the timer.&lt;/p&gt;

@see &lt;a href=&quot;QTimer.html#start()&quot;&gt;&lt;tt&gt;start&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final int timerId()" doc="/**
&lt;p&gt;Returns the ID of the timer if the timer is running; otherwise returns -1.&lt;/p&gt;
 */"/>
    <method name="protected void timerEvent(com.trolltech.qt.core.QTimerEvent arg__1)" doc="/**
&lt;p&gt;This function is reimplemented for internal reasons.&lt;/p&gt;
 */"/>
</class>