summaryrefslogtreecommitdiff
path: root/src/sensors/qrotationsensor.cpp
diff options
context:
space:
mode:
authorSergio Ahumada <sergio.ahumada@digia.com>2013-03-19 11:05:55 +0100
committerSergio Ahumada <sergio.ahumada@digia.com>2013-03-19 11:06:33 +0100
commit50c16eab20a6d9884ab3149ef59137a10de63e6d (patch)
tree2684617d911514147283516ddd15803a4049da61 /src/sensors/qrotationsensor.cpp
parentd2cafb8506b798bad7fa56f19557dd6e1cb25cd7 (diff)
parent879e5536b033302b2ad976750cd2351674e161d6 (diff)
downloadqtsensors-50c16eab20a6d9884ab3149ef59137a10de63e6d.tar.gz
Merge branch 'dev' into stable
This starts Qt 5.1 release cycle Change-Id: Idce0f9b94f9e585abfb6903f554500a06f4f8aaa
Diffstat (limited to 'src/sensors/qrotationsensor.cpp')
-rw-r--r--src/sensors/qrotationsensor.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/sensors/qrotationsensor.cpp b/src/sensors/qrotationsensor.cpp
index 9acc1cd..06ee406 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 to \a hasZ. 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