1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QGYROSCOPE_H
5#define QGYROSCOPE_H
6
7#include <QtSensors/qsensor.h>
8
9QT_BEGIN_NAMESPACE
10
11class QGyroscopeReadingPrivate;
12
13class Q_SENSORS_EXPORT QGyroscopeReading : public QSensorReading
14{
15 Q_OBJECT
16 Q_PROPERTY(qreal x READ x)
17 Q_PROPERTY(qreal y READ y)
18 Q_PROPERTY(qreal z READ z)
19 DECLARE_READING(QGyroscopeReading)
20public:
21 qreal x() const;
22 void setX(qreal x);
23
24 qreal y() const;
25 void setY(qreal y);
26
27 qreal z() const;
28 void setZ(qreal z);
29};
30
31class Q_SENSORS_EXPORT QGyroscopeFilter : public QSensorFilter
32{
33public:
34 virtual bool filter(QGyroscopeReading *reading) = 0;
35private:
36 bool filter(QSensorReading *reading) override;
37};
38
39class Q_SENSORS_EXPORT QGyroscope : public QSensor
40{
41 Q_OBJECT
42public:
43 explicit QGyroscope(QObject *parent = nullptr);
44 virtual ~QGyroscope();
45 QGyroscopeReading *reading() const;
46 static char const * const sensorType;
47
48private:
49 Q_DISABLE_COPY(QGyroscope)
50};
51
52QT_END_NAMESPACE
53
54#endif
55
56

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