com.trolltech.qt.core
Class QBasicTimer

java.lang.Object
  extended by com.trolltech.qt.internal.QSignalEmitterInternal
      extended by com.trolltech.qt.QSignalEmitter
          extended by com.trolltech.qt.QtJambiObject
              extended by com.trolltech.qt.core.QBasicTimer
All Implemented Interfaces:
QtJambiInterface, java.lang.Cloneable

public class QBasicTimer
extends QtJambiObject
implements java.lang.Cloneable

The QBasicTimer class provides timer events for objects. This is a fast, lightweight, and low-level class used by Qt internally. We recommend using the higher-level QTimer class rather than this class if you want to use timers in your applications.

To use this class, create a QBasicTimer, and call its start() function with a timeout interval and with a pointer to a QObject subclass. When the timer times out it will send a timer event to the QObject subclass. The timer can be stopped at any time using stop(). isActive() returns true for a timer that is running; i.e. it has been started, has not reached the timeout time, and has not been stopped. The timer's ID can be retrieved using timerId().

The Wiggly example uses QBasicTimer to repaint a widget at regular intervals.

See also:
QTimer, QTimerEvent, QObject::timerEvent(), Timers, and Wiggly Example.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
QSignalEmitter.AbstractSignal, QSignalEmitter.PrivateSignal0, QSignalEmitter.PrivateSignal1, QSignalEmitter.PrivateSignal2, QSignalEmitter.PrivateSignal3, QSignalEmitter.PrivateSignal4, QSignalEmitter.PrivateSignal5, QSignalEmitter.PrivateSignal6, QSignalEmitter.PrivateSignal7, QSignalEmitter.PrivateSignal8, QSignalEmitter.PrivateSignal9, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9
 
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal
 
Field Summary
 
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
currentSender
 
Constructor Summary
QBasicTimer()
          Contructs a basic timer.
 
Method Summary
 QBasicTimer clone()
          This method is reimplemented for internal reasons
 boolean isActive()
          Returns true if the timer is running, has not yet timed out, and has not been stopped; otherwise returns false.
 void start(int msec, QObject obj)
          Starts (or restarts) the timer with a msec milliseconds timeout.
 void stop()
          Stops the timer.
 int timerId()
          Returns the timer's ID.
 
Methods inherited from class com.trolltech.qt.QtJambiObject
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr
 
Methods inherited from class com.trolltech.qt.QSignalEmitter
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread
 
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
__qt_signalInitialization
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.trolltech.qt.QtJambiInterface
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership
 

Constructor Detail

QBasicTimer

public QBasicTimer()
Contructs a basic timer.

See also:
start().

Method Detail

isActive

public final boolean isActive()
Returns true if the timer is running, has not yet timed out, and has not been stopped; otherwise returns false.

See also:
start(), and stop().


start

public final void start(int msec,
                        QObject obj)
Starts (or restarts) the timer with a msec milliseconds timeout.

The given object will receive timer events.

See also:
stop(), isActive(), and QObject::timerEvent().


stop

public final void stop()
Stops the timer.

See also:
start(), and isActive().


timerId

public final int timerId()
Returns the timer's ID.

See also:
QTimerEvent::timerId().


clone

public QBasicTimer clone()
This method is reimplemented for internal reasons

Overrides:
clone in class java.lang.Object