Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.trolltech.qt.core
Class QBasicTimer

    java.lang.Object
      com.trolltech.qt.QSignalEmitter
          com.trolltech.qt.QtJambiObject
              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.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9`

Constructor Summary
`QBasicTimer()` Contructs a basic timer.

Method Summary
`QBasicTimer` | `clone()` This method is reimplemented for internal reasons
`static QBasicTimer` | `fromNativePointer(QNativePointer nativePointer)` This method 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, equals, 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
`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()`.

### fromNativePointer

    public static QBasicTimer fromNativePointer(QNativePointer nativePointer)

  This method returns the QBasicTimer instance pointed to by `nativePointer`.

### nativePointerArray

    public static QNativePointer nativePointerArray(QBasicTimer[] array)

  This function returns a QNativePointer that is pointing to the specified QBasicTimer array.

### clone

    public QBasicTimer clone()

  This method is reimplemented for internal reasons

  Overrides:
    `clone` in class `java.lang.Object`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD