diff options
author | Thomas McGuire <thomas.mcguire.qnx@kdab.com> | 2013-02-01 09:44:00 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-08 11:17:45 +0100 |
commit | ae6d8a286b760198705e877a5ba4c1eecc7a5e8d (patch) | |
tree | ef93fec2264376743fe0fdf8bac1cac1dfe3d13d /src/sensors/qrotationsensor.cpp | |
parent | a3f4766964022ff0dc7ea0832922c2a58ab47e82 (diff) |
Convert QRotationSensor::hasZ to a proper property
Change-Id: I32edf761653fbe9d08710703b02fb1c0183aba3e
Reviewed-by: Lorn Potter <lorn.potter@jollamobile.com>
Diffstat (limited to 'src/sensors/qrotationsensor.cpp')
-rw-r--r-- | src/sensors/qrotationsensor.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/sensors/qrotationsensor.cpp b/src/sensors/qrotationsensor.cpp index 9acc1cd8..ea0515ca 100644 --- a/src/sensors/qrotationsensor.cpp +++ b/src/sensors/qrotationsensor.cpp @@ -201,7 +201,7 @@ char const * const QRotationSensor::type("QRotationSensor"); Construct the sensor as a child of \a parent. */ QRotationSensor::QRotationSensor(QObject *parent) - : QSensor(QRotationSensor::type, parent) + : QSensor(QRotationSensor::type, *new QRotationSensorPrivate, parent) { } @@ -228,6 +228,28 @@ QRotationSensor::~QRotationSensor() Returns false if z is not available. */ +bool QRotationSensor::hasZ() const +{ + Q_D(const QRotationSensor); + return (d->hasZ); +} + +/*! + \since 5.1 + + Sets whether the z angle is available. This is to be called from the + backend. By default the hasZ property is true, so a backend only has to + call this if its rotation sensor can not report z angles. +*/ +void QRotationSensor::setHasZ(bool hasZ) +{ + Q_D(QRotationSensor); + if (d->hasZ != hasZ) { + d->hasZ = hasZ; + emit hasZChanged(hasZ); + } +} + #include "moc_qrotationsensor.cpp" QT_END_NAMESPACE |