diff options
author | Tamás Martinec <tamas.martinec@symbio.com> | 2021-11-09 15:51:38 +0200 |
---|---|---|
committer | Tamás Martinec <tamas.martinec@symbio.com> | 2021-11-17 12:15:38 +0200 |
commit | 9e6bd24a0672700b710ff36d59e6b38e67473f71 (patch) | |
tree | 16659c9a12b1f81087e756d69937de2c66c295ed /src/plugins/sensors/ios/iospressure.h | |
parent | 851ec98b341ed8ad67caac32653178e0bb189bfe (diff) |
QtSensors: Implement iOS pressure sensor
Task-number: QTBUG-70877
Pick-to: 6.2
Change-Id: Ibff63b412a1cc5a8234d3c7600ec70a717acab7d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/plugins/sensors/ios/iospressure.h')
-rw-r--r-- | src/plugins/sensors/ios/iospressure.h | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/src/plugins/sensors/ios/iospressure.h b/src/plugins/sensors/ios/iospressure.h new file mode 100644 index 00000000..f4796e11 --- /dev/null +++ b/src/plugins/sensors/ios/iospressure.h @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** 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 IOSPRESSURE_H +#define IOSPRESSURE_H + +#include <qsensorbackend.h> +#include <qpressuresensor.h> + +@class CMAltimeter; + +QT_BEGIN_NAMESPACE + +class IOSPressure : public QSensorBackend +{ +public: + static char const * const id; + + explicit IOSPressure(QSensor *sensor); + ~IOSPressure(); + void timerEvent(QTimerEvent *) override; + + void start() override; + void stop() override; + +private: + Q_DISABLE_COPY_MOVE(IOSPressure) + CMAltimeter *m_altimeter = nullptr; + QPressureReading m_reading; + int m_timer = 0; + + static int s_startCount; +}; +QT_END_NAMESPACE + +#endif // IOSPRESSURE_H + |