diff options
author | Lincoln Ramsay <lincoln.ramsay@nokia.com> | 2011-08-01 13:16:02 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-08-01 05:20:26 +0200 |
commit | c5a4a7a7a9565a29fa70f1bc858f9a3628c237b4 (patch) | |
tree | 197f96b96227cee741716075831ae42a9092e3c3 /src/sensors | |
parent | 22260646a9fa7dffbd506b6bdd2586ad3d4d3556 (diff) |
remove qtimestamp
Just use a quint64.
Not binary compatible but source compatible.
Change-Id: I240baeef905744f844f3c37b2739fd9a6562af15
Reviewed-on: http://codereview.qt.nokia.com/2412
Reviewed-by: Lorn Potter <lorn.potter@nokia.com>
Diffstat (limited to 'src/sensors')
-rw-r--r-- | src/sensors/qsensor.cpp | 34 | ||||
-rw-r--r-- | src/sensors/qsensor.h | 21 | ||||
-rw-r--r-- | src/sensors/qsensor_p.h | 2 | ||||
-rw-r--r-- | src/sensors/qsensorbackend.cpp | 2 |
4 files changed, 17 insertions, 42 deletions
diff --git a/src/sensors/qsensor.cpp b/src/sensors/qsensor.cpp index 2658d22d..62691c85 100644 --- a/src/sensors/qsensor.cpp +++ b/src/sensors/qsensor.cpp @@ -50,24 +50,6 @@ QT_BEGIN_NAMESPACE /*! - \typedef qtimestamp - \relates QSensor - - Sensor timestamps are represented by this typedef which is a 64 bit unsigned integer. - - 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). - - \bold{Note that some platforms do not deliver timestamps correctly}. - Applications should be prepared for occasional issues that cause timestamps to jump - forwards or backwards. The \l{sensors-api.html#platform-notes}{platform notes} have - more details. -*/ - -/*! \typedef qrange \relates QSensor @@ -161,7 +143,6 @@ QT_BEGIN_NAMESPACE */ // A bit of a hack to call qRegisterMetaType when the library is loaded. -static int qtimestamp_id = qRegisterMetaType<qtimestamp>("qtimestamp"); static int qrange_id = qRegisterMetaType<qrange>("qrange"); static int qrangelist_id = qRegisterMetaType<qrangelist>("qrangelist"); static int qoutputrangelist_id = qRegisterMetaType<qoutputrangelist>("qoutputrangelist"); @@ -837,13 +818,22 @@ QSensorReading::~QSensorReading() \property QSensorReading::timestamp \brief the timestamp of the reading. - \sa qtimestamp + 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). + + \bold{Note that some platforms do not deliver timestamps correctly}. + Applications should be prepared for occasional issues that cause timestamps to jump + forwards or backwards. The \l{sensors-api.html#platform-notes}{platform notes} have + more details. */ /*! Returns the timestamp of the reading. */ -qtimestamp QSensorReading::timestamp() const +quint64 QSensorReading::timestamp() const { return d->timestamp; } @@ -851,7 +841,7 @@ qtimestamp QSensorReading::timestamp() const /*! Sets the \a timestamp of the reading. */ -void QSensorReading::setTimestamp(qtimestamp timestamp) +void QSensorReading::setTimestamp(quint64 timestamp) { d->timestamp = timestamp; } diff --git a/src/sensors/qsensor.h b/src/sensors/qsensor.h index f4d1a773..305315c2 100644 --- a/src/sensors/qsensor.h +++ b/src/sensors/qsensor.h @@ -56,20 +56,6 @@ class QSensorReading; class QSensorReadingPrivate; class QSensorFilter; -#ifdef Q_QDOC -typedef quint64 qtimestamp; -#else -class qtimestamp -{ -public: - qtimestamp() : value() {} - qtimestamp(quint64 timestamp) : value(timestamp) {} - operator quint64() const { return value; } -private: - quint64 value; -}; -#endif - typedef QPair<int,int> qrange; typedef QList<qrange> qrangelist; struct qoutputrange @@ -186,12 +172,12 @@ class Q_SENSORS_EXPORT QSensorReading : public QObject friend class QSensorBackend; Q_OBJECT - Q_PROPERTY(qtimestamp timestamp READ timestamp) + Q_PROPERTY(quint64 timestamp READ timestamp) public: virtual ~QSensorReading(); - qtimestamp timestamp() const; - void setTimestamp(qtimestamp timestamp); + quint64 timestamp() const; + void setTimestamp(quint64 timestamp); // Access properties of sub-classes by numeric index // For name-based access use QObject::property() @@ -243,7 +229,6 @@ private: QT_END_NAMESPACE -Q_DECLARE_METATYPE(qtimestamp) Q_DECLARE_METATYPE(qrange) Q_DECLARE_METATYPE(qrangelist) Q_DECLARE_METATYPE(qoutputrangelist) diff --git a/src/sensors/qsensor_p.h b/src/sensors/qsensor_p.h index 1ca59b3c..3260e7f8 100644 --- a/src/sensors/qsensor_p.h +++ b/src/sensors/qsensor_p.h @@ -110,7 +110,7 @@ public: } // sensor data cache - qtimestamp timestamp; + quint64 timestamp; }; QT_END_NAMESPACE diff --git a/src/sensors/qsensorbackend.cpp b/src/sensors/qsensorbackend.cpp index 7f4730d5..6d4317ab 100644 --- a/src/sensors/qsensorbackend.cpp +++ b/src/sensors/qsensorbackend.cpp @@ -175,7 +175,7 @@ QSensorReading *QSensorBackend::reading() const void poll() { - qtimestamp timestamp; + quint64 timestamp; qreal x, y, z; ... QAccelerometerReading *reading = static_cast<QAccelerometerReading*>(reading()); |