1// Copyright (C) 2016 Research In Motion
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3#ifndef QPRESSURESENSOR_H
4#define QPRESSURESENSOR_H
5
6#include <QtSensors/qsensor.h>
7
8QT_BEGIN_NAMESPACE
9
10class QPressureReadingPrivate;
11
12class Q_SENSORS_EXPORT QPressureReading : public QSensorReading
13{
14 Q_OBJECT
15 Q_PROPERTY(qreal pressure READ pressure)
16 Q_PROPERTY(qreal temperature READ temperature)
17 DECLARE_READING(QPressureReading)
18public:
19 qreal pressure() const;
20 void setPressure(qreal pressure);
21
22 qreal temperature() const;
23 void setTemperature(qreal temperature);
24};
25
26class Q_SENSORS_EXPORT QPressureFilter : public QSensorFilter
27{
28public:
29 virtual bool filter(QPressureReading *reading) = 0;
30private:
31 bool filter(QSensorReading *reading) override;
32};
33
34class Q_SENSORS_EXPORT QPressureSensor : public QSensor
35{
36 Q_OBJECT
37public:
38 explicit QPressureSensor(QObject *parent = nullptr);
39 ~QPressureSensor();
40 QPressureReading *reading() const;
41 static char const * const sensorType;
42
43private:
44 Q_DISABLE_COPY(QPressureSensor)
45};
46
47QT_END_NAMESPACE
48
49#endif
50

source code of qtsensors/src/sensors/qpressuresensor.h