Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QtopiaTimer Class Reference
[QtBaseModule]

The QtopiaTimer class provides timers that can pause automatically when the screen is off. More...

    #include <QtopiaTimer>

Inherits QObject.

Public Types

Public Functions

Public Slots

Signals

Additional Inherited Members


Detailed Description

The QtopiaTimer class provides timers that can pause automatically when the screen is off.

The use of this class is similar to QTimer as the API is the same, except setInterval() and start() now have an optional argument that is the type() of pausing behavior to use.

When the type is PauseWhenInactive, the timer will pause while the screen is off. This allows applications to more easily suspend repetitive processing when the user is not able to interact with the application.

See also QTimer.


Member Type Documentation

enum QtopiaTimer::Type

This enum type specifies the behavior that QtopiaTimer uses.

ConstantValueDescription
QtopiaTimer::Normal0x0000operate as a QTimer.
QtopiaTimer::PauseWhenInactive0x0001pause while the screen turns off.


Member Function Documentation

QtopiaTimer::QtopiaTimer ( QObject * parent = 0 )

Creates a new QtopiaTimer instance with the specified parent.

QtopiaTimer::~QtopiaTimer ()   [virtual]

Destroys the QtopiaTimer instance.

int QtopiaTimer::interval () const

Returns the number of milliseconds that the QtopiaTimer will wait. A value of 0 means that the timer will time out as soon as all the events in the window system event queue have been processed.

See also setInterval().

bool QtopiaTimer::isActive () const

Returns true if the timer is active; false otherwise.

See also start() and stop().

bool QtopiaTimer::isSingleShot () const

Returns true if the timer is a single-shot timer; false otherwise. Single-shot timers do not restart automatically.

See also setSingleShot().

void QtopiaTimer::setInterval ( int msec, QtopiaTimer::Type type = Normal )

Sets the timer to wait msec milliseconds before triggering. The type is set to type.

See also interval() and type().

void QtopiaTimer::setSingleShot ( bool singleShot )

Sets the timer to be a single-shot timer if singleShot is true. If singleShot is false the timer will restart automatically.

See also isSingleShot().

void QtopiaTimer::start ()   [slot]

Starts the timer using the previously-set values.

See also setInterval().

void QtopiaTimer::start ( int msec, QtopiaTimer::Type type = Normal )   [slot]

This is an overloaded member function, provided for convenience.

Starts the timer with a new interval msec and type.

See also setInterval() and start().

void QtopiaTimer::stop ()   [slot]

Stops the timer.

See also isActive().

void QtopiaTimer::timeout ()   [signal]

This signal is emitted when the timer interval has elapsed. Unless the timer is a single-shot timer, it will automatically restart and so trigger after the interval passes again.

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

Type QtopiaTimer::type () const

Returns the type of the timer.

See also QtopiaTimer::Type and setInterval().


Copyright © 2009 Trolltech Trademarks
Qt Extended 4.4.3