QSensorReading Class

The QSensorReading class holds the readings from the sensor. More...

Properties

Public Functions

quint64 timestamp() const

Macros

DECLARE_READING(classname)
IMPLEMENT_READING(classname)

Detailed Description

Note that QSensorReading is not particularly useful by itself. The interesting data for each sensor is defined in a sub-class of QSensorReading.

Property Documentation

timestamp : const quint64

This property holds the timestamp of the reading.

Timestamps values are microseconds since a fixed point. You can use timestamps to see how far apart two sensor readings are.

Note that sensor timestamps from different sensors may not be directly comparable (as they may choose different fixed points for their reference).

Note that some platforms do not deliver timestamps correctly. Applications should be prepared for occasional issues that cause timestamps to jump backwards.

Access functions:

quint64 timestamp() const

Macro Documentation

DECLARE_READING(classname)

The DECLARE_READING macro adds some required methods to a reading class.

This macro should be used for all reading classes. Pass the classname of your reading class.

 class MyReading : public QSensorReading
 {
     Q_OBJECT
     Q_PROPERTY(qreal myprop READ myprop)
     DECLARE_READING(MyReading)
 public:
     qreal myprop() const;
     vod setMyprop(qreal myprop);
 };

See also IMPLEMENT_READING().

IMPLEMENT_READING(classname)

The IMPLEMENT_READING macro implements the required methods for a reading class.

This macro should be used for all reading classes. It should be placed into a single compilation unit (source file), not into a header file. Pass the classname of your reading class.

 IMPLEMENT_READING(MyReading)

See also DECLARE_READING().