diff options
Diffstat (limited to 'src/sensors')
-rw-r--r-- | src/sensors/CMakeLists.txt | 9 | ||||
-rw-r--r-- | src/sensors/doc/src/compatmap.qdoc | 67 | ||||
-rw-r--r-- | src/sensors/doc/src/qt6-changes.qdoc | 11 | ||||
-rw-r--r-- | src/sensors/qaltimeter.cpp | 151 | ||||
-rw-r--r-- | src/sensors/qaltimeter.h | 81 | ||||
-rw-r--r-- | src/sensors/qaltimeter_p.h | 68 | ||||
-rw-r--r-- | src/sensors/qdistancesensor.cpp | 163 | ||||
-rw-r--r-- | src/sensors/qdistancesensor.h | 82 | ||||
-rw-r--r-- | src/sensors/qdistancesensor_p.h | 75 | ||||
-rw-r--r-- | src/sensors/qholstersensor.cpp | 157 | ||||
-rw-r--r-- | src/sensors/qholstersensor.h | 81 | ||||
-rw-r--r-- | src/sensors/qholstersensor_p.h | 68 | ||||
-rw-r--r-- | src/sensors/qirproximitysensor.cpp | 3 | ||||
-rw-r--r-- | src/sensors/qlidsensor.cpp | 3 | ||||
-rw-r--r-- | src/sensors/qtapsensor.cpp | 3 |
15 files changed, 22 insertions, 1000 deletions
diff --git a/src/sensors/CMakeLists.txt b/src/sensors/CMakeLists.txt index 4a687b48..9b33c372 100644 --- a/src/sensors/CMakeLists.txt +++ b/src/sensors/CMakeLists.txt @@ -17,12 +17,9 @@ qt_internal_add_module(Sensors sensorlog_p.h qsensor.h qaccelerometer.h - qaltimeter.h qambientlightsensor.h qambienttemperaturesensor.h qcompass.h - qdistancesensor.h - qholstersensor.h qlightsensor.h qmagnetometer.h qorientationsensor.h @@ -37,12 +34,9 @@ qt_internal_add_module(Sensors qlidsensor.h qsensor_p.h qaccelerometer_p.h - qaltimeter_p.h qambientlightsensor_p.h qambienttemperaturesensor_p.h qcompass_p.h - qdistancesensor_p.h - qholstersensor_p.h qlightsensor_p.h qmagnetometer_p.h qorientationsensor_p.h @@ -57,12 +51,9 @@ qt_internal_add_module(Sensors qlidsensor_p.h qsensor.cpp qaccelerometer.cpp - qaltimeter.cpp qambientlightsensor.cpp qambienttemperaturesensor.cpp qcompass.cpp - qdistancesensor.cpp - qholstersensor.cpp qlightsensor.cpp qmagnetometer.cpp qorientationsensor.cpp diff --git a/src/sensors/doc/src/compatmap.qdoc b/src/sensors/doc/src/compatmap.qdoc index 4f3bb8d4..a8ba2fcd 100644 --- a/src/sensors/doc/src/compatmap.qdoc +++ b/src/sensors/doc/src/compatmap.qdoc @@ -40,11 +40,11 @@ </tr> <tr> <td bgcolor="green"></td> - <td>The feature is fully supported.</td> + <td>The sensor is supported.</td> </tr> <tr> <td bgcolor="gray"></td> - <td>The feature is not supported.</td> + <td>The sensor is not supported.</td> </tr> </tbody> </table> @@ -70,15 +70,6 @@ <td bgcolor="green"></td> </tr> <tr> - <td nowrap="nowrap">Altimeter</td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - </tr> - <tr> <td nowrap="nowrap">Ambient Light Sensor</td> <td bgcolor="gray"></td> <td bgcolor="gray"></td> @@ -106,15 +97,6 @@ <td bgcolor="gray"></td> </tr> <tr> - <td nowrap="nowrap">Distance</td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - </tr> - <tr> <td nowrap="nowrap">Gyroscope</td> <td bgcolor="green"></td> <td bgcolor="gray"></td> @@ -124,15 +106,6 @@ <td bgcolor="green"></td> </tr> <tr> - <td nowrap="nowrap">Holster Sensor</td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - </tr> - <tr> <td nowrap="nowrap">Humidity Sensor</td> <td bgcolor="gray"></td> <td bgcolor="gray"></td> @@ -142,24 +115,6 @@ <td bgcolor="green"></td> </tr> <tr> - <td nowrap="nowrap">IR Proximity Sensor</td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - </tr> - <tr> - <td nowrap="nowrap">Lid Sensor</td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - </tr> - <tr> <td nowrap="nowrap">Light Sensor</td> <td bgcolor="green"></td> <td bgcolor="green"></td> @@ -214,15 +169,6 @@ <td bgcolor="gray"></td> </tr> <tr> - <td nowrap="nowrap">Tap Sensor</td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - </tr> - <tr> <td nowrap="nowrap">Tilt Sensor</td> <td bgcolor="gray"></td> <td bgcolor="gray"></td> @@ -231,15 +177,6 @@ <td bgcolor="green"></td> <td bgcolor="gray"></td> </tr> - <tr> - <td nowrap="nowrap">Sensor Gestures</td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - <td bgcolor="gray"></td> - </tr> </table> \endraw diff --git a/src/sensors/doc/src/qt6-changes.qdoc b/src/sensors/doc/src/qt6-changes.qdoc index 9cce19d4..4b4d2585 100644 --- a/src/sensors/doc/src/qt6-changes.qdoc +++ b/src/sensors/doc/src/qt6-changes.qdoc @@ -49,9 +49,20 @@ \section2 sensorfw + \section2 sensorfw + The \l {https://git.sailfishos.org/mer-core/sensorfw}{sensorfw} does not yet have a Qt 6 port and is therefore not yet supported by sensors in Qt 6. + \section2 Removed sensors + + QAltimeter, QDistanceSensor, QHolsterSensor and their QML counterparts + did no longer have a backend implementation and have been removed. + + QIRProximitySensor, QLidSensor, and QTapSensor have only sensorfw + backend, and as such they are not currently listed as supported sensor + types. + \section1 API changes \section2 Deleted typedef for qtimestamp diff --git a/src/sensors/qaltimeter.cpp b/src/sensors/qaltimeter.cpp deleted file mode 100644 index ddac14e0..00000000 --- a/src/sensors/qaltimeter.cpp +++ /dev/null @@ -1,151 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Research In Motion -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include <qaltimeter.h> -#include "qaltimeter_p.h" - -QT_BEGIN_NAMESPACE - -IMPLEMENT_READING(QAltimeterReading) - -/*! - \class QAltimeterReading - \ingroup sensors_reading - \inmodule QtSensors - \since 5.1 - - \brief The QAltimeterReading class holds readings from the altimeter sensor. - - The altitude is reported in meters relative to mean sea level. -*/ - -/*! - \property QAltimeterReading::altitude - \brief The altitude in meters relative to mean sea level. -*/ - -qreal QAltimeterReading::altitude() const -{ - return d->altitude; -} - -/*! - Sets the altitude to \a altitude. -*/ -void QAltimeterReading::setAltitude(qreal altitude) -{ - d->altitude = altitude; -} - -// ===================================================================== - -/*! - \class QAltimeterFilter - \ingroup sensors_filter - \inmodule QtSensors - \since 5.1 - - \brief The QAltimeterFilter class is a convenience wrapper around QSensorFilter. - - The only difference is that the filter() method features a pointer to QAltimeterReading - instead of QSensorReading. -*/ - -/*! - \fn QAltimeterFilter::filter(QAltimeterReading *reading) - - Called when \a reading changes. Returns false to prevent the reading from propagating. - - \sa QSensorFilter::filter() -*/ - -bool QAltimeterFilter::filter(QSensorReading *reading) -{ - return filter(static_cast<QAltimeterReading*>(reading)); -} - -char const * const QAltimeter::sensorType("QAltimeter"); - -/*! - \class QAltimeter - \ingroup sensors_type - \inmodule QtSensors - \since 5.1 - - \brief The QAltimeter 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 QAltimeterReading instead of a QSensorReading. - - For details about how the sensor works, see \l QAltimeterReading. - - \sa QAltimeterReading -*/ - -/*! - Construct the sensor as a child of \a parent. -*/ -QAltimeter::QAltimeter(QObject *parent) - : QSensor(QAltimeter::sensorType, parent) -{ -} - -/*! - Destroy the sensor. Stops the sensor if it has not already been stopped. -*/ -QAltimeter::~QAltimeter() -{ -} - -/*! - \fn QAltimeter::reading() const - - Returns the reading class for this sensor. - - \sa QSensor::reading() -*/ - -QAltimeterReading *QAltimeter::reading() const -{ - return static_cast<QAltimeterReading*>(QSensor::reading()); -} - -QT_END_NAMESPACE - -#include "moc_qaltimeter.cpp" diff --git a/src/sensors/qaltimeter.h b/src/sensors/qaltimeter.h deleted file mode 100644 index e62ce344..00000000 --- a/src/sensors/qaltimeter.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Research In Motion -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef QALTIMETER_H -#define QALTIMETER_H - -#include <QtSensors/qsensor.h> - -QT_BEGIN_NAMESPACE - -class QAltimeterReadingPrivate; - -class Q_SENSORS_EXPORT QAltimeterReading : public QSensorReading -{ - Q_OBJECT - Q_PROPERTY(qreal altitude READ altitude) - DECLARE_READING(QAltimeterReading) -public: - qreal altitude() const; - void setAltitude(qreal altitude); -}; - -class Q_SENSORS_EXPORT QAltimeterFilter : public QSensorFilter -{ -public: - virtual bool filter(QAltimeterReading *reading) = 0; -private: - bool filter(QSensorReading *reading) override; -}; - -class Q_SENSORS_EXPORT QAltimeter : public QSensor -{ - Q_OBJECT -public: - explicit QAltimeter(QObject *parent = nullptr); - ~QAltimeter(); - QAltimeterReading *reading() const; - static char const * const sensorType; - -private: - Q_DISABLE_COPY(QAltimeter) -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/sensors/qaltimeter_p.h b/src/sensors/qaltimeter_p.h deleted file mode 100644 index b1231c24..00000000 --- a/src/sensors/qaltimeter_p.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Research In Motion -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef QALTIMETER_P_H -#define QALTIMETER_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_NAMESPACE - -class QAltimeterReadingPrivate -{ -public: - QAltimeterReadingPrivate() - : altitude(0) - { - } - - qreal altitude; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/sensors/qdistancesensor.cpp b/src/sensors/qdistancesensor.cpp deleted file mode 100644 index 3b778b90..00000000 --- a/src/sensors/qdistancesensor.cpp +++ /dev/null @@ -1,163 +0,0 @@ - /**************************************************************************** - ** - ** Copyright (C) 2016 BlackBerry Limited. All rights reserved. - ** Contact: https://www.qt.io/licensing/ - ** - ** 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 The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/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 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include <qdistancesensor.h> -#include "qdistancesensor_p.h" - -QT_BEGIN_NAMESPACE - -IMPLEMENT_READING(QDistanceReading) - -/*! - \class QDistanceReading - \ingroup sensors_reading - \inmodule QtSensors - \since 5.4 - - \brief The QDistanceReading class holds distance reading in cm from the proximity sensor. - - The QDistanceReading class holds distance reading in cm from the proximity sensor. - Note: Some proximity sensor only support two values for distance, a near and far value. - In this case, the sensor should report its maximum range value to represent the far state, - and a lesser value to represent the near state. - - \section2 QDistanceReading Units - The distance is measured in cm - - The distance sensor is typically located in the front face of a device, and thus will - measure the distance of an object from the device's front face. -*/ - -/*! - \property QDistanceReading::distance - \brief distance of object from front face of device - - \sa {QDistanceReading Units} -*/ - -qreal QDistanceReading::distance() const -{ - return d->distance; -} - -/*! - Sets distance to \a distance. -*/ -void QDistanceReading::setDistance(qreal distance) -{ - d->distance = distance; -} - -// ===================================================================== - -/*! - \class QDistanceFilter - \ingroup sensors_filter - \inmodule QtSensors - \since 5.4 - - \brief The QDistanceFilter class is a convenience wrapper around QSensorFilter. - - The only difference is that the filter() method features a pointer to QDistanceReading - instead of QSensorReading. -*/ - -/*! - \fn QDistanceFilter::filter(QDistanceReading *reading) - - Called when \a reading changes. Returns false to prevent the reading from propagating. - - \sa QSensorFilter::filter() -*/ - -bool QDistanceFilter::filter(QSensorReading *reading) -{ - return filter(static_cast<QDistanceReading*>(reading)); -} - -char const * const QDistanceSensor::sensorType("QDistanceSensor"); - -/*! - \class QDistanceSensor - \ingroup sensors_type - \inmodule QtSensors - \since 5.4 - - \brief The QDistanceSensor class is a convenience wrapper around QSensor. - - The only behavioral difference is that this class sets the type properly. - - This class also features a reading() function that returns a QDistanceReading instead of a QSensorReading. - - For details about how the sensor works, see \l QDistanceReading. - - \sa QDistanceReading -*/ - -/*! - Construct the sensor as a child of \a parent. -*/ -QDistanceSensor::QDistanceSensor(QObject *parent) - : QSensor(QDistanceSensor::sensorType, parent) -{ -} - -/*! - Destroy the sensor. Stops the sensor if it has not already been stopped. -*/ -QDistanceSensor::~QDistanceSensor() -{ -} - -/*! - \fn QDistanceSensor::reading() const - - Returns the reading class for this sensor. - - \sa QSensor::reading() -*/ - -QDistanceReading *QDistanceSensor::reading() const -{ - return static_cast<QDistanceReading*>(QSensor::reading()); -} - -QT_END_NAMESPACE - -#include "moc_qdistancesensor.cpp" diff --git a/src/sensors/qdistancesensor.h b/src/sensors/qdistancesensor.h deleted file mode 100644 index b50c0942..00000000 --- a/src/sensors/qdistancesensor.h +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 BlackBerry Limited. All rights reserved. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QDISTANCESENSOR_H -#define QDISTANCESENSOR_H - -#include <QtSensors/qsensor.h> - -QT_BEGIN_NAMESPACE - -class QDistanceReadingPrivate; - -class Q_SENSORS_EXPORT QDistanceReading : public QSensorReading -{ - Q_OBJECT - Q_PROPERTY(qreal distance READ distance) - DECLARE_READING(QDistanceReading) -public: - qreal distance() const; - void setDistance(qreal distance); -}; - -class Q_SENSORS_EXPORT QDistanceFilter : public QSensorFilter -{ -public: - virtual bool filter(QDistanceReading *reading) = 0; -private: - bool filter(QSensorReading *reading) override; -}; - -class Q_SENSORS_EXPORT QDistanceSensor : public QSensor -{ - Q_OBJECT -public: - explicit QDistanceSensor(QObject *parent = nullptr); - ~QDistanceSensor(); - QDistanceReading *reading() const; - static char const * const sensorType; - -private: - Q_DISABLE_COPY(QDistanceSensor) -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/sensors/qdistancesensor_p.h b/src/sensors/qdistancesensor_p.h deleted file mode 100644 index 262fdb1e..00000000 --- a/src/sensors/qdistancesensor_p.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 BlackBerry Limited. All rights reserved. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QDISTANCESENSOR_P_H -#define QDISTANCESENSOR_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_NAMESPACE - -class QDistanceReadingPrivate -{ -public: - QDistanceReadingPrivate() - : distance(0.0) - { - } - - /* - * Note that this class is copied so you may need to implement - * a copy constructor if you have complex types or pointers - * as values. - */ - - qreal distance; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/sensors/qholstersensor.cpp b/src/sensors/qholstersensor.cpp deleted file mode 100644 index 19a2b3c9..00000000 --- a/src/sensors/qholstersensor.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Research In Motion -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include <qholstersensor.h> -#include "qholstersensor_p.h" - -QT_BEGIN_NAMESPACE - -IMPLEMENT_READING(QHolsterReading) - -/*! - \class QHolsterReading - \ingroup sensors_reading - \inmodule QtSensors - \since 5.1 - - \brief The QHolsterReading class holds readings from the holster sensor. - - \section2 QHolsterReading Units - The holster sensor can detect if a device is holstered or not. A holster is a pocket, - similar to a gun holster, specifically made for the device. If the device is inside of this - pocket, it is holstered. The holster supports the device in detecting whether the device is - holstered or not. -*/ - -/*! - \property QHolsterReading::holstered - \brief A value indicating whether the device is holstered. - - \sa {QHolsterReading Units} -*/ - -bool QHolsterReading::holstered() const -{ - return d->holstered; -} - -/*! - Sets the holstered value to \a holstered. -*/ -void QHolsterReading::setHolstered(bool holstered) -{ - d->holstered = holstered; -} - -// ===================================================================== - -/*! - \class QHolsterFilter - \ingroup sensors_filter - \inmodule QtSensors - \since 5.1 - - \brief The QHolsterFilter class is a convenience wrapper around QSensorFilter. - - The only difference is that the filter() method features a pointer to QHolsterReading - instead of QSensorReading. -*/ - -/*! - \fn QHolsterFilter::filter(QHolsterReading *reading) - - Called when \a reading changes. Returns false to prevent the reading from propagating. - - \sa QSensorFilter::filter() -*/ - -bool QHolsterFilter::filter(QSensorReading *reading) -{ - return filter(static_cast<QHolsterReading*>(reading)); -} - -char const * const QHolsterSensor::sensorType("QHolsterSensor"); - -/*! - \class QHolsterSensor - \ingroup sensors_type - \inmodule QtSensors - \since 5.1 - - \brief The QHolsterSensor 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 QHolsterReading instead of a QSensorReading. - - For details about how the sensor works, see \l QHolsterReading. - - \sa QHolsterReading -*/ - -/*! - Construct the sensor as a child of \a parent. -*/ -QHolsterSensor::QHolsterSensor(QObject *parent) - : QSensor(QHolsterSensor::sensorType, parent) -{ -} - -/*! - Destroy the sensor. Stops the sensor if it has not already been stopped. -*/ -QHolsterSensor::~QHolsterSensor() -{ -} - -/*! - \fn QHolsterSensor::reading() const - - Returns the reading class for this sensor. - - \sa QSensor::reading() -*/ - -QHolsterReading *QHolsterSensor::reading() const -{ - return static_cast<QHolsterReading*>(QSensor::reading()); -} - -QT_END_NAMESPACE - -#include "moc_qholstersensor.cpp" diff --git a/src/sensors/qholstersensor.h b/src/sensors/qholstersensor.h deleted file mode 100644 index 586e31b4..00000000 --- a/src/sensors/qholstersensor.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Research In Motion -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef QHOLSTERSENSOR_H -#define QHOLSTERSENSOR_H - -#include <QtSensors/qsensor.h> - -QT_BEGIN_NAMESPACE - -class QHolsterReadingPrivate; - -class Q_SENSORS_EXPORT QHolsterReading : public QSensorReading -{ - Q_OBJECT - Q_PROPERTY(bool holstered READ holstered) - DECLARE_READING(QHolsterReading) -public: - bool holstered() const; - void setHolstered(bool holstered); -}; - -class Q_SENSORS_EXPORT QHolsterFilter : public QSensorFilter -{ -public: - virtual bool filter(QHolsterReading *reading) = 0; -private: - bool filter(QSensorReading *reading) override; -}; - -class Q_SENSORS_EXPORT QHolsterSensor : public QSensor -{ - Q_OBJECT -public: - explicit QHolsterSensor(QObject *parent = nullptr); - ~QHolsterSensor(); - QHolsterReading *reading() const; - static char const * const sensorType; - -private: - Q_DISABLE_COPY(QHolsterSensor) -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/sensors/qholstersensor_p.h b/src/sensors/qholstersensor_p.h deleted file mode 100644 index 3d8b9801..00000000 --- a/src/sensors/qholstersensor_p.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Research In Motion -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef QHOLSTERSENSOR_P_H -#define QHOLSTERSENSOR_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_NAMESPACE - -class QHolsterReadingPrivate -{ -public: - QHolsterReadingPrivate() - : holstered(false) - { - } - - bool holstered; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/sensors/qirproximitysensor.cpp b/src/sensors/qirproximitysensor.cpp index 85c8347e..ae3dfaf1 100644 --- a/src/sensors/qirproximitysensor.cpp +++ b/src/sensors/qirproximitysensor.cpp @@ -49,6 +49,7 @@ IMPLEMENT_READING(QIRProximityReading) \ingroup sensors_reading \inmodule QtSensors \since 5.1 + \internal \brief The QIRProximityReading class holds readings from the IR proximity sensor. @@ -101,6 +102,7 @@ void QIRProximityReading::setReflectance(qreal reflectance) \ingroup sensors_filter \inmodule QtSensors \since 5.1 + \internal \brief The QIRProximityFilter class is a convenience wrapper around QSensorFilter. @@ -128,6 +130,7 @@ char const * const QIRProximitySensor::sensorType("QIRProximitySensor"); \ingroup sensors_type \inmodule QtSensors \since 5.1 + \internal \brief The QIRProximitySensor class is a convenience wrapper around QSensor. diff --git a/src/sensors/qlidsensor.cpp b/src/sensors/qlidsensor.cpp index d46daa49..6fb88e36 100644 --- a/src/sensors/qlidsensor.cpp +++ b/src/sensors/qlidsensor.cpp @@ -48,6 +48,7 @@ IMPLEMENT_READING(QLidReading) \ingroup sensors_reading \inmodule QtSensors \since 5.9 + \internal \brief The QLidReading class holds readings from the Lid sensor. @@ -110,6 +111,7 @@ void QLidReading::setFrontLidClosed(bool closed) \ingroup sensors_filter \inmodule QtSensors \since 5.9 + \internal \brief The QLidFilter class is a convenience wrapper around QSensorFilter. @@ -137,6 +139,7 @@ char const * const QLidSensor::sensorType("QLidSensor"); \ingroup sensors_type \inmodule QtSensors \since 5.9 + \internal \brief The QLidSensor class is a convenience wrapper around QSensor. diff --git a/src/sensors/qtapsensor.cpp b/src/sensors/qtapsensor.cpp index dbfcbaa2..a0df3cd3 100644 --- a/src/sensors/qtapsensor.cpp +++ b/src/sensors/qtapsensor.cpp @@ -49,6 +49,7 @@ IMPLEMENT_READING(QTapReading) \ingroup sensors_reading \inmodule QtSensors \since 5.1 + \internal \brief The QTapReading class represents one reading from the tap sensor. @@ -174,6 +175,7 @@ void QTapReading::setDoubleTap(bool doubleTap) \ingroup sensors_filter \inmodule QtSensors \since 5.1 + \internal \brief The QTapFilter class is a convenience wrapper around QSensorFilter. @@ -201,6 +203,7 @@ char const * const QTapSensor::sensorType("QTapSensor"); \ingroup sensors_type \inmodule QtSensors \since 5.1 + \internal \brief The QTapSensor class is a convenience wrapper around QSensor. |