Table Of Contents

Previous topic

QMetaEnum

Next topic

QPersistentModelIndex

QBasicTimer

Synopsis

Functions

Detailed Description

The PySide.QtCore.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 PySide.QtCore.QTimer class rather than this class if you want to use timers in your applications. Note that this timer is a repeating timer that will send subsequent timer events unless the PySide.QtCore.QBasicTimer.stop() function is called.

To use this class, create a PySide.QtCore.QBasicTimer , and call its PySide.QtCore.QBasicTimer.start() function with a timeout interval and with a pointer to a PySide.QtCore.QObject subclass. When the timer times out it will send a timer event to the PySide.QtCore.QObject subclass. The timer can be stopped at any time using PySide.QtCore.QBasicTimer.stop() . PySide.QtCore.QBasicTimer.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 PySide.QtCore.QBasicTimer.timerId() .

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

class PySide.QtCore.QBasicTimer
class PySide.QtCore.QBasicTimer(QBasicTimer)
Parameters:QBasicTimerPySide.QtCore.QBasicTimer

Contructs a basic timer.

PySide.QtCore.QBasicTimer.isActive()
Return type:PySide.QtCore.bool

Returns true if the timer is running and has not been stopped; otherwise returns false.

PySide.QtCore.QBasicTimer.start(msec, obj)
Parameters:

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

The given object will receive timer events.

PySide.QtCore.QBasicTimer.stop()

Stops the timer.

PySide.QtCore.QBasicTimer.timerId()
Return type:PySide.QtCore.int

Returns the timer’s ID.