Qt Jambi Home

com.trolltech.qt.core
Class QBasicTimer

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

public class QBasicTimer
extends QtJambiObject

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, Wiggly Example

Nested Class Summary
 
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I>
 
Constructor Summary
QBasicTimer()
          Contructs a basic timer.
 
Method Summary
static QBasicTimer fromNativePointer(QNativePointer nativePointer)
          This function returns the QBasicTimer instance pointed to by nativePointer
 boolean isActive()
          Returns true if the timer is running, has not yet timed out, and has not been stopped; otherwise returns false.
static QNativePointer nativePointerArray(QBasicTimer[] array)
          This function returns a QNativePointer that is pointing to the specified QBasicTimer array.
 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, finalize, reassignNativeResources, tr, tr, tr
 
Methods inherited from class com.trolltech.qt.QSignalEmitter
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread
 
Methods inherited from class java.lang.Object
clone, equals, 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, stop

start

public final void start(int msec,
                        QObject obj)

Starts (or restarts) the timer with a msec milliseconds timeout.

The given obj will receive timer events.

See Also:
stop, isActive, QObject::timerEvent

stop

public final void stop()

Stops the timer.

See Also:
start, isActive

timerId

public final int timerId()

Returns the timer's ID.

See Also:
QTimerEvent::timerId

fromNativePointer

public static QBasicTimer fromNativePointer(QNativePointer nativePointer)
This function returns the QBasicTimer instance pointed to by nativePointer

Parameters:
nativePointer - the QNativePointer of which object should be returned.

nativePointerArray

public static QNativePointer nativePointerArray(QBasicTimer[] array)
This function returns a QNativePointer that is pointing to the specified QBasicTimer array.

Parameters:
array - the array that the returned pointer will point to.
Returns:
a QNativePointer that is pointing to the specified array.

Qt Jambi Home