The QSystemAlignedTimer class provides a service for applications to synchronize their activity. More...
#include <QSystemAlignedTimer>
Inherits: QObject.
This class was introduced in Qt Mobility 1.2.
enum | AlignedTimerError { NoError, AlignedTimerNotSupported, InvalidArgument, TimerFailed, InternalError } |
QSystemAlignedTimer ( QObject * parent = 0 ) | |
~QSystemAlignedTimer () | |
bool | isActive () const |
bool | isSingleShot () const |
AlignedTimerError | lastError () const |
int | maximumInterval () const |
int | minimumInterval () const |
void | setMaximumInterval ( int seconds ) |
void | setMinimumInterval ( int seconds ) |
void | setSingleShot ( bool singleShot ) |
void | wokeUp () |
void | start ( int minimumTime, int maximumTime ) |
void | start () |
void | stop () |
void | error ( QSystemAlignedTimer::AlignedTimerError error ) |
void | timeout () |
void | singleShot ( int minimumTime, int maximumTime, QObject * receiver, const char * member ) |
The QSystemAlignedTimer class provides a service for applications to synchronize their activity.
QSystemAlignedTimer is a fuzzy timer that allows applications that must do periodic activity like after being in sleep mode a certain period, to synchronize their activities in the same window of time.
For example send network "alive" messages at the same time (i.e. turn the wireless radio on at the same time).
The service is not only for network-aware applications, it is for use by any applications that need to periodic wake-ups.
The recommended use case is when app uses single-shot timer only: set mintime 0 for the first call 'to jump to the train' and mintime > 0 after 1st wakeup.
This enum describes the last known AlignedTimerError
Constant | Value | Description |
---|---|---|
QSystemAlignedTimer::NoError | 0 | No error. |
QSystemAlignedTimer::AlignedTimerNotSupported | 1 | The aligned timer is not support on this platform |
QSystemAlignedTimer::InvalidArgument | 2 | Interval arguments are invalid. |
QSystemAlignedTimer::TimerFailed | 3 | General timer failure. |
QSystemAlignedTimer::InternalError | 4 | Internal error. |
Returns true if the timer is running; otherwise false.
Access functions:
bool | isActive () const |
This property holds the timer's maximumInterval.
Returns this current timer maximum interval.
Access functions:
int | maximumInterval () const |
void | setMaximumInterval ( int seconds ) |
This property holds the timers's minimumInterval.
Returns this current timer minimum interval.
Access functions:
int | minimumInterval () const |
void | setMinimumInterval ( int seconds ) |
Whether the timer is single shot.
Access functions:
bool | isSingleShot () const |
void | setSingleShot ( bool singleShot ) |
Constructs a QSystemAlignedTimer object with the given parent.
Destructs the QSystemAlignedTimer
This signal is emitted when an error happens.
Returns the last AlignedTimerError.
This static function starts a timer to call a slot after a minimumTime interval has elapsed, and ensures that it will be called before the maximumTime has elapsed.
These values are specified in seconds.
The receiver is the receiver object and the member is the slot.
See also setSingleShot().
Starts the timer with the minimal interval of minimumTime, and maximum interval maximumTime in seconds.
This is not a guaranteed interval, and the timeout signal may be fired at any time, depending on other clients attached to this timer.
In the case of minimalInterval of 0, it means 'wake me up when someone else is woken up'.
If you need a window of time in which your timer should fire, use QSystemAlignedTimer::setWindow
Starts the alignedtimer.
Stops this timer request.
This signal is emitted when the timer times out.
This should be called when the application wakes up via other means than QSystemAlignedTimer timeout.
Other applications that are in their wakeup window *may* be woken up. Single-shot timer is canceled, and reoccuring timer interval will restart.
Symbian does not support this wokeUp call for reoccuring timers and will simply ignore it.
© 2008-2011 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners. Privacy Policy
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
Alternatively, this document may be used under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.