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 QROTATIONSENSOR_H
5#define QROTATIONSENSOR_H
6
7#include <QtSensors/qsensor.h>
8
9QT_BEGIN_NAMESPACE
10
11class QRotationReadingPrivate;
12
13class Q_SENSORS_EXPORT QRotationReading : 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(QRotationReading)
20public:
21 qreal x() const;
22 qreal y() const;
23 qreal z() const;
24
25 void setFromEuler(qreal x, qreal y, qreal z);
26};
27
28class Q_SENSORS_EXPORT QRotationFilter : public QSensorFilter
29{
30public:
31 virtual bool filter(QRotationReading *reading) = 0;
32private:
33 bool filter(QSensorReading *reading) override;
34};
35
36class QRotationSensorPrivate;
37
38class Q_SENSORS_EXPORT QRotationSensor : public QSensor
39{
40 Q_OBJECT
41 Q_PROPERTY(bool hasZ READ hasZ NOTIFY hasZChanged)
42public:
43 explicit QRotationSensor(QObject *parent = nullptr);
44 virtual ~QRotationSensor();
45 QRotationReading *reading() const;
46 static char const * const sensorType;
47
48 bool hasZ() const;
49 void setHasZ(bool hasZ);
50
51Q_SIGNALS:
52 void hasZChanged(bool hasZ);
53
54private:
55 Q_DECLARE_PRIVATE(QRotationSensor)
56 Q_DISABLE_COPY(QRotationSensor)
57};
58
59QT_END_NAMESPACE
60
61#endif
62
63

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