summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/imports/sensors/plugins.qmltypes11
-rw-r--r--src/imports/sensors/qmlpressuresensor.cpp133
-rw-r--r--src/imports/sensors/qmlpressuresensor.h88
-rw-r--r--src/imports/sensors/sensors.cpp3
-rw-r--r--src/imports/sensors/sensors.pro2
-rw-r--r--src/plugins/sensors/blackberry/bbpressuresensor.cpp29
-rw-r--r--src/plugins/sensors/blackberry/bbpressuresensor.h19
-rw-r--r--src/plugins/sensors/blackberry/main.cpp2
-rw-r--r--src/sensors/doc/src/compatmap.qdoc6
-rw-r--r--src/sensors/qpressuresensor.cpp147
-rw-r--r--src/sensors/qpressuresensor.h88
-rw-r--r--src/sensors/qpressuresensor_p.h72
-rw-r--r--src/sensors/sensors.pro1
13 files changed, 559 insertions, 42 deletions
diff --git a/src/imports/sensors/plugins.qmltypes b/src/imports/sensors/plugins.qmltypes
index 00d8c366..1429ae79 100644
--- a/src/imports/sensors/plugins.qmltypes
+++ b/src/imports/sensors/plugins.qmltypes
@@ -118,6 +118,17 @@ Module {
Property { name: "orientation"; type: "QOrientationReading::Orientation"; isReadonly: true }
}
Component {
+ name: "QmlPressureReading"
+ prototype: "QmlSensorReading"
+ exports: ["PressureReading 5.1"]
+ Property { name: "pressure"; type: "double"; isReadonly: true }
+ }
+ Component {
+ name: "QmlPressureSensor"
+ prototype: "QmlSensor"
+ exports: ["PressureSensor 5.1"]
+ }
+ Component {
name: "QmlProximitySensor"
prototype: "QmlSensor"
exports: ["ProximitySensor 5.0", "ProximitySensor 5.1"]
diff --git a/src/imports/sensors/qmlpressuresensor.cpp b/src/imports/sensors/qmlpressuresensor.cpp
new file mode 100644
index 00000000..a21f7c0d
--- /dev/null
+++ b/src/imports/sensors/qmlpressuresensor.cpp
@@ -0,0 +1,133 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Research In Motion
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtSensors module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "qmlpressuresensor.h"
+#include <QPressureSensor>
+
+/*!
+ \qmltype PressureSensor
+ \instantiates QmlPressureSensor
+ \ingroup qml-sensors_type
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.1
+ \inherits Sensor
+ \brief The PressureSensor element reports on atmospheric pressure values.
+
+ The PressureSensor element reports on atmospheric pressure values.
+
+ This element wraps the QPressureSensor class. Please see the documentation for
+ QPressureSensor for details.
+
+ \sa PressureReading
+*/
+
+QmlPressureSensor::QmlPressureSensor(QObject *parent)
+ : QmlSensor(parent)
+ , m_sensor(new QPressureSensor(this))
+{
+}
+
+QmlPressureSensor::~QmlPressureSensor()
+{
+}
+
+QmlSensorReading *QmlPressureSensor::createReading() const
+{
+ return new QmlPressureReading(m_sensor);
+}
+
+QSensor *QmlPressureSensor::sensor() const
+{
+ return m_sensor;
+}
+
+/*!
+ \qmltype PressureReading
+ \instantiates QmlPressureReading
+ \ingroup qml-sensors_reading
+ \inqmlmodule QtSensors 5.0
+ \since QtSensors 5.1
+ \inherits SensorReading
+ \brief The PressureReading element holds the most recent PressureSensor reading.
+
+ The PressureReading element holds the most recent PressureSensor reading.
+
+ This element wraps the QPressureReading class. Please see the documentation for
+ QPressureReading for details.
+
+ This element cannot be directly created.
+*/
+
+QmlPressureReading::QmlPressureReading(QPressureSensor *sensor)
+ : QmlSensorReading(sensor)
+ , m_sensor(sensor)
+ , m_pressure(0)
+{
+}
+
+QmlPressureReading::~QmlPressureReading()
+{
+}
+
+/*!
+ \qmlproperty qreal PressureReading::pressure
+ This property holds the atmospheric pressure value in Pascals.
+
+ Please see QPressureReading::pressure for information about this property.
+*/
+
+qreal QmlPressureReading::pressure() const
+{
+ return m_pressure;
+}
+
+QSensorReading *QmlPressureReading::reading() const
+{
+ return m_sensor->reading();
+}
+
+void QmlPressureReading::readingUpdate()
+{
+ qreal pressure = m_sensor->reading()->pressure();
+ if (m_pressure != pressure) {
+ m_pressure = pressure;
+ Q_EMIT pressureChanged();
+ }
+}
diff --git a/src/imports/sensors/qmlpressuresensor.h b/src/imports/sensors/qmlpressuresensor.h
new file mode 100644
index 00000000..e150c7df
--- /dev/null
+++ b/src/imports/sensors/qmlpressuresensor.h
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Research In Motion
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtSensors module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef QMLPRESSURESENSOR_H
+#define QMLPRESSURESENSOR_H
+
+#include "qmlsensor.h"
+
+QT_BEGIN_HEADER
+QT_BEGIN_NAMESPACE
+
+class QPressureSensor;
+
+class QmlPressureSensor : public QmlSensor
+{
+ Q_OBJECT
+public:
+ explicit QmlPressureSensor(QObject *parent = 0);
+ ~QmlPressureSensor();
+
+private:
+ QSensor *sensor() const Q_DECL_OVERRIDE;
+ QmlSensorReading *createReading() const Q_DECL_OVERRIDE;
+
+ QPressureSensor *m_sensor;
+};
+
+class QmlPressureReading : public QmlSensorReading
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal pressure READ pressure NOTIFY pressureChanged)
+public:
+ explicit QmlPressureReading(QPressureSensor *sensor);
+ ~QmlPressureReading();
+
+ qreal pressure() const;
+
+Q_SIGNALS:
+ void pressureChanged();
+
+private:
+ QSensorReading *reading() const Q_DECL_OVERRIDE;
+ void readingUpdate() Q_DECL_OVERRIDE;
+
+ QPressureSensor *m_sensor;
+ qreal m_pressure;
+};
+
+QT_END_NAMESPACE
+QT_END_HEADER
+#endif
diff --git a/src/imports/sensors/sensors.cpp b/src/imports/sensors/sensors.cpp
index 95fc8ccc..9392baf3 100644
--- a/src/imports/sensors/sensors.cpp
+++ b/src/imports/sensors/sensors.cpp
@@ -66,6 +66,7 @@
#include "qmllightsensor.h"
#include "qmlmagnetometer.h"
#include "qmlorientationsensor.h"
+#include "qmlpressuresensor.h"
#include "qmlproximitysensor.h"
#include "qmlrotationsensor.h"
#include "qmltapsensor.h"
@@ -150,6 +151,8 @@ public:
qmlRegisterUncreatableType<QmlMagnetometerReading >(package, major, minor, "MagnetometerReading", QLatin1String("Cannot create MagnetometerReading"));
qmlRegisterType <QmlOrientationSensor >(package, major, minor, "OrientationSensor");
qmlRegisterUncreatableType<QmlOrientationSensorReading >(package, major, minor, "OrientationReading", QLatin1String("Cannot create OrientationReading"));
+ qmlRegisterType <QmlPressureSensor >(package, major, minor, "PressureSensor");
+ qmlRegisterUncreatableType<QmlPressureReading >(package, major, minor, "PressureReading", QLatin1String("Cannot create PressureReading"));
qmlRegisterType <QmlProximitySensor >(package, major, minor, "ProximitySensor");
qmlRegisterUncreatableType<QmlProximitySensorReading >(package, major, minor, "ProximityReading", QLatin1String("Cannot create ProximityReading"));
qmlRegisterType <QmlRotationSensor >(package, major, minor, "RotationSensor");
diff --git a/src/imports/sensors/sensors.pro b/src/imports/sensors/sensors.pro
index 76362014..82241511 100644
--- a/src/imports/sensors/sensors.pro
+++ b/src/imports/sensors/sensors.pro
@@ -16,6 +16,7 @@ HEADERS += \
qmllightsensor.h \
qmlmagnetometer.h \
qmlorientationsensor.h \
+ qmlpressuresensor.h\
qmlproximitysensor.h \
qmltapsensor.h \
qmlrotationsensor.h \
@@ -34,6 +35,7 @@ SOURCES += sensors.cpp \
qmllightsensor.cpp \
qmlmagnetometer.cpp \
qmlorientationsensor.cpp \
+ qmlpressuresensor.cpp\
qmlproximitysensor.cpp \
qmltapsensor.cpp \
qmlrotationsensor.cpp \
diff --git a/src/plugins/sensors/blackberry/bbpressuresensor.cpp b/src/plugins/sensors/blackberry/bbpressuresensor.cpp
index 01a2493b..8cb9b1ea 100644
--- a/src/plugins/sensors/blackberry/bbpressuresensor.cpp
+++ b/src/plugins/sensors/blackberry/bbpressuresensor.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2012 Research In Motion
+** Copyright (C) 2013 Research In Motion
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtSensors module of the Qt Toolkit.
@@ -40,31 +40,8 @@
****************************************************************************/
#include "bbpressuresensor.h"
-class BbPressureReadingPrivate
-{
-public:
- BbPressureReadingPrivate()
- : pressure(0)
- {
- }
-
- qreal pressure;
-};
-
-IMPLEMENT_READING(BbPressureReading)
-
-qreal BbPressureReading::pressure() const
-{
- return d->pressure;
-}
-
-void BbPressureReading::setPressure(qreal pressure)
-{
- d->pressure = pressure;
-}
-
BbPressureSensor::BbPressureSensor(QSensor *sensor)
- : BbSensorBackend<BbPressureReading>(devicePath(), SENSOR_TYPE_PRESSURE, sensor)
+ : BbSensorBackend<QPressureReading>(devicePath(), SENSOR_TYPE_PRESSURE, sensor)
{
setDescription(QLatin1String("Pressure in Pascals"));
}
@@ -74,7 +51,7 @@ QString BbPressureSensor::devicePath()
return QLatin1String("/dev/sensor/pressure");
}
-bool BbPressureSensor::updateReadingFromEvent(const sensor_event_t &event, BbPressureReading *reading)
+bool BbPressureSensor::updateReadingFromEvent(const sensor_event_t &event, QPressureReading *reading)
{
// TODO: I was unable to test this since the device I was testing this with did not have
// a pressure sensor. Verify that this works and check that the units are correct.
diff --git a/src/plugins/sensors/blackberry/bbpressuresensor.h b/src/plugins/sensors/blackberry/bbpressuresensor.h
index 833832c4..7531bd68 100644
--- a/src/plugins/sensors/blackberry/bbpressuresensor.h
+++ b/src/plugins/sensors/blackberry/bbpressuresensor.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2012 Research In Motion
+** Copyright (C) 2013 Research In Motion
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtSensors module of the Qt Toolkit.
@@ -42,20 +42,9 @@
#define BBPRESSURESENSOR_H
#include "bbsensorbackend.h"
+#include <qpressuresensor.h>
-class BbPressureReadingPrivate;
-
-class BbPressureReading : public QSensorReading
-{
- Q_OBJECT
- Q_PROPERTY(qreal pressure READ pressure)
- DECLARE_READING(BbPressureReading)
-public:
- qreal pressure() const;
- void setPressure(qreal pressure);
-};
-
-class BbPressureSensor : public BbSensorBackend<BbPressureReading>
+class BbPressureSensor : public BbSensorBackend<QPressureReading>
{
Q_OBJECT
@@ -65,7 +54,7 @@ public:
static QString devicePath();
protected:
- bool updateReadingFromEvent(const sensor_event_t &event, BbPressureReading *reading) Q_DECL_OVERRIDE;
+ bool updateReadingFromEvent(const sensor_event_t &event, QPressureReading *reading) Q_DECL_OVERRIDE;
};
#endif
diff --git a/src/plugins/sensors/blackberry/main.cpp b/src/plugins/sensors/blackberry/main.cpp
index 54e4163a..7b4180a9 100644
--- a/src/plugins/sensors/blackberry/main.cpp
+++ b/src/plugins/sensors/blackberry/main.cpp
@@ -98,7 +98,7 @@ public:
if (sensorSupported(BbOrientationSensor::devicePath()))
QSensorManager::registerBackend(QOrientationSensor::type, bbOrientationSensorId, this);
if (sensorSupported(BbPressureSensor::devicePath()))
- QSensorManager::registerBackend("BbPressureSensor", bbPressureSensorId, this);
+ QSensorManager::registerBackend(QPressureSensor::type, bbPressureSensorId, this);
if (sensorSupported(BbProximitySensor::devicePath()))
QSensorManager::registerBackend(QProximitySensor::type, bbProximitySensorId, this);
if (sensorSupported(BbRotationSensor::devicePath()))
diff --git a/src/sensors/doc/src/compatmap.qdoc b/src/sensors/doc/src/compatmap.qdoc
index 0fd4951c..065ff79e 100644
--- a/src/sensors/doc/src/compatmap.qdoc
+++ b/src/sensors/doc/src/compatmap.qdoc
@@ -106,6 +106,12 @@
<td bgcolor="green"></td>
</tr>
<tr>
+ <td nowrap="nowrap">Pressure Sensor</td>
+ <td bgcolor="green"></td>
+ <td bgcolor="gray"></td>
+ <td bgcolor="gray"></td>
+ </tr>
+ <tr>
<td nowrap="nowrap">Proximity Sensor</td>
<td bgcolor="green"></td>
<td bgcolor="gray"></td>
diff --git a/src/sensors/qpressuresensor.cpp b/src/sensors/qpressuresensor.cpp
new file mode 100644
index 00000000..ea8a79bb
--- /dev/null
+++ b/src/sensors/qpressuresensor.cpp
@@ -0,0 +1,147 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Research In Motion
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtSensors module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qpressuresensor.h>
+#include "qpressuresensor_p.h"
+
+QT_BEGIN_NAMESPACE
+
+IMPLEMENT_READING(QPressureReading)
+
+/*!
+ \class QPressureReading
+ \ingroup sensors_reading
+ \inmodule QtSensors
+ \since 5.1
+
+ \brief The QPressureReading class holds readings from the pressure sensor.
+
+ \section2 QPressureReading Units
+
+ The pressure sensor returns atmospheric pressure values in Pascals.
+*/
+
+/*!
+ \property QPressureReading::pressure
+ \brief The measured atmospheric pressure.
+
+ Returned as Pascals.
+ \sa {QPressureReading Units}
+*/
+
+qreal QPressureReading::pressure() const
+{
+ return d->pressure;
+}
+
+/*!
+ Sets the pressure to \a pressure.
+*/
+void QPressureReading::setPressure(qreal pressure)
+{
+ d->pressure = pressure;
+}
+
+// =====================================================================
+
+/*!
+ \class QPressureFilter
+ \ingroup sensors_filter
+ \inmodule QtSensors
+ \since 5.1
+
+ \brief The QPressureFilter class is a convenience wrapper around QSensorFilter.
+
+ The only difference is that the filter() method features a pointer to QPressureReading
+ instead of QSensorReading.
+*/
+
+/*!
+ \fn QPressureFilter::filter(QPressureReading *reading)
+
+ Called when \a reading changes. Returns false to prevent the reading from propagating.
+
+ \sa QSensorFilter::filter()
+*/
+
+char const * const QPressureSensor::type("QPressureSensor");
+
+/*!
+ \class QPressureSensor
+ \ingroup sensors_type
+ \inmodule QtSensors
+ \since 5.1
+
+ \brief The QPressureSensor class is a convenience wrapper around QSensor.
+
+ The only behavioural difference is that this class sets the type properly.
+
+ This class also features a reading() function that returns a QPressureReading instead of a QSensorReading.
+
+ For details about how the sensor works, see \l QPressureReading.
+
+ \sa QPressureReading
+*/
+
+/*!
+ Construct the sensor as a child of \a parent.
+*/
+QPressureSensor::QPressureSensor(QObject *parent)
+ : QSensor(QPressureSensor::type, parent)
+{
+}
+
+/*!
+ Destroy the sensor. Stops the sensor if it has not already been stopped.
+*/
+QPressureSensor::~QPressureSensor()
+{
+}
+
+/*!
+ \fn QPressureSensor::reading() const
+
+ Returns the reading class for this sensor.
+
+ \sa QSensor::reading()
+*/
+
+#include "moc_qpressuresensor.cpp"
+QT_END_NAMESPACE
diff --git a/src/sensors/qpressuresensor.h b/src/sensors/qpressuresensor.h
new file mode 100644
index 00000000..80c99f0e
--- /dev/null
+++ b/src/sensors/qpressuresensor.h
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Research In Motion
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtSensors module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef QPRESSURESENSOR_H
+#define QPRESSURESENSOR_H
+
+#include <QtSensors/qsensor.h>
+
+QT_BEGIN_HEADER
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(QtSensors)
+
+class QPressureReadingPrivate;
+
+class Q_SENSORS_EXPORT QPressureReading : public QSensorReading
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal pressure READ pressure)
+ DECLARE_READING(QPressureReading)
+public:
+ qreal pressure() const;
+ void setPressure(qreal pressure);
+};
+
+class Q_SENSORS_EXPORT QPressureFilter : public QSensorFilter
+{
+public:
+ virtual bool filter(QPressureReading *reading) = 0;
+private:
+ bool filter(QSensorReading *reading) Q_DECL_OVERRIDE
+ { return filter(static_cast<QPressureReading*>(reading)); }
+};
+
+class Q_SENSORS_EXPORT QPressureSensor : public QSensor
+{
+ Q_OBJECT
+public:
+ explicit QPressureSensor(QObject *parent = 0);
+ ~QPressureSensor();
+ QPressureReading *reading() const { return static_cast<QPressureReading*>(QSensor::reading()); }
+ static char const * const type;
+
+private:
+ Q_DISABLE_COPY(QPressureSensor)
+};
+
+QT_END_NAMESPACE
+QT_END_HEADER
+
+#endif
diff --git a/src/sensors/qpressuresensor_p.h b/src/sensors/qpressuresensor_p.h
new file mode 100644
index 00000000..4067ccbe
--- /dev/null
+++ b/src/sensors/qpressuresensor_p.h
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Research In Motion
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtSensors module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef QPRESSURESENSOR_P_H
+#define QPRESSURESENSOR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+QT_BEGIN_HEADER
+QT_BEGIN_NAMESPACE
+
+class QPressureReadingPrivate
+{
+public:
+ QPressureReadingPrivate()
+ : pressure(0)
+ {
+ }
+
+ qreal pressure;
+};
+
+QT_END_NAMESPACE
+QT_END_HEADER
+
+#endif
diff --git a/src/sensors/sensors.pro b/src/sensors/sensors.pro
index 2cb33468..6f943aba 100644
--- a/src/sensors/sensors.pro
+++ b/src/sensors/sensors.pro
@@ -62,6 +62,7 @@ SENSORS=\
qtapsensor\
qtiltsensor\
qgyroscope\
+ qpressuresensor\
for(s,SENSORS) {
# Client API