Table Of Contents

Previous topic


Next topic





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)

Contructs a basic timer.

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)

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

The given object will receive timer events.


Stops the timer.


Returns the timer’s ID.