Fix tray visibility and message reception issues
Some checks failed
build / build-win64 (push) Waiting to run
build / build-macos (push) Waiting to run
build / build-pip (push) Failing after 16s

- Disable sound initialization to prevent hanging
- Add missing import re in utils.py
- Fix settings loading for QSettings
- Update file paths to use PROJECT_ROOT
- Revert to working API paths and listener from commit efdc63e
This commit is contained in:
kdusek
2025-12-07 22:39:07 +01:00
parent 7b695d7b7f
commit 5138303016
4060 changed files with 579123 additions and 23 deletions

View File

@@ -0,0 +1,6 @@
# Automatically generated configuration for PyQt6.QtSensors.
sip-version = "6.14.0"
sip-abi-version = "13.8"
module-tags = ["Qt_6_10_0", "Linux"]
module-disabled-features = []

View File

@@ -0,0 +1,64 @@
// QtSensorsmod.sip generated by MetaSIP
//
// This file is part of the QtSensors Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%Module(name=PyQt6.QtSensors, keyword_arguments="Optional", use_limited_api=True)
%Import QtCore/QtCoremod.sip
%Copying
Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
This file is part of PyQt6.
This file may be used under the terms of the GNU General Public License
version 3.0 as published by the Free Software Foundation and appearing in
the file LICENSE included in the packaging of this file. Please review the
following information to ensure the GNU General Public License version 3.0
requirements will be met: http://www.gnu.org/copyleft/gpl.html.
If you do not wish to use this file under the terms of the GPL version 3.0
then you may purchase a commercial license. For more information contact
info@riverbankcomputing.com.
This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%End
%DefaultSupertype PyQt6.sip.simplewrapper
%Include qaccelerometer.sip
%Include qambientlightsensor.sip
%Include qambienttemperaturesensor.sip
%Include qcompass.sip
%Include qgyroscope.sip
%Include qhumiditysensor.sip
%Include qirproximitysensor.sip
%Include qlidsensor.sip
%Include qlightsensor.sip
%Include qmagnetometer.sip
%Include qorientationsensor.sip
%Include qpressuresensor.sip
%Include qproximitysensor.sip
%Include qrotationsensor.sip
%Include qsensor.sip
%Include qtapsensor.sip
%Include qtiltsensor.sip

View File

@@ -0,0 +1,81 @@
// qaccelerometer.sip generated by MetaSIP
//
// This file is part of the QtSensors Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_6_2_0 -)
class QAccelerometerReading : public QSensorReading /NoDefaultCtors/
{
%TypeHeaderCode
#include <qaccelerometer.h>
%End
public:
qreal x() const;
void setX(qreal x);
qreal y() const;
void setY(qreal y);
qreal z() const;
void setZ(qreal z);
};
%End
%If (Qt_6_2_0 -)
class QAccelerometerFilter : public QSensorFilter
{
%TypeHeaderCode
#include <qaccelerometer.h>
%End
public:
virtual bool filter(QAccelerometerReading *reading) = 0;
};
%End
%If (Qt_6_2_0 -)
class QAccelerometer : public QSensor
{
%TypeHeaderCode
#include <qaccelerometer.h>
%End
public:
explicit QAccelerometer(QObject *parent /TransferThis/ = 0);
virtual ~QAccelerometer();
enum AccelerationMode
{
Combined,
Gravity,
User,
};
QAccelerometer::AccelerationMode accelerationMode() const;
void setAccelerationMode(QAccelerometer::AccelerationMode accelerationMode);
QAccelerometerReading *reading() const;
signals:
void accelerationModeChanged(QAccelerometer::AccelerationMode accelerationMode /ScopesStripped=1/);
};
%End

View File

@@ -0,0 +1,74 @@
// qambientlightsensor.sip generated by MetaSIP
//
// This file is part of the QtSensors Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_6_2_0 -)
class QAmbientLightReading : public QSensorReading /NoDefaultCtors/
{
%TypeHeaderCode
#include <qambientlightsensor.h>
%End
public:
enum LightLevel
{
Undefined,
Dark,
Twilight,
Light,
Bright,
Sunny,
};
QAmbientLightReading::LightLevel lightLevel() const;
void setLightLevel(QAmbientLightReading::LightLevel lightLevel);
};
%End
%If (Qt_6_2_0 -)
class QAmbientLightFilter : public QSensorFilter
{
%TypeHeaderCode
#include <qambientlightsensor.h>
%End
public:
virtual bool filter(QAmbientLightReading *reading) = 0;
};
%End
%If (Qt_6_2_0 -)
class QAmbientLightSensor : public QSensor
{
%TypeHeaderCode
#include <qambientlightsensor.h>
%End
public:
explicit QAmbientLightSensor(QObject *parent /TransferThis/ = 0);
virtual ~QAmbientLightSensor();
QAmbientLightReading *reading() const;
};
%End

View File

@@ -0,0 +1,64 @@
// qambienttemperaturesensor.sip generated by MetaSIP
//
// This file is part of the QtSensors Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_6_2_0 -)
class QAmbientTemperatureReading : public QSensorReading /NoDefaultCtors/
{
%TypeHeaderCode
#include <qambienttemperaturesensor.h>
%End
public:
qreal temperature() const;
void setTemperature(qreal temperature);
};
%End
%If (Qt_6_2_0 -)
class QAmbientTemperatureFilter : public QSensorFilter
{
%TypeHeaderCode
#include <qambienttemperaturesensor.h>
%End
public:
virtual bool filter(QAmbientTemperatureReading *reading) = 0;
};
%End
%If (Qt_6_2_0 -)
class QAmbientTemperatureSensor : public QSensor
{
%TypeHeaderCode
#include <qambienttemperaturesensor.h>
%End
public:
explicit QAmbientTemperatureSensor(QObject *parent /TransferThis/ = 0);
virtual ~QAmbientTemperatureSensor();
QAmbientTemperatureReading *reading() const;
};
%End

View File

@@ -0,0 +1,66 @@
// qcompass.sip generated by MetaSIP
//
// This file is part of the QtSensors Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_6_2_0 -)
class QCompassReading : public QSensorReading /NoDefaultCtors/
{
%TypeHeaderCode
#include <qcompass.h>
%End
public:
qreal azimuth() const;
void setAzimuth(qreal azimuth);
qreal calibrationLevel() const;
void setCalibrationLevel(qreal calibrationLevel);
};
%End
%If (Qt_6_2_0 -)
class QCompassFilter : public QSensorFilter
{
%TypeHeaderCode
#include <qcompass.h>
%End
public:
virtual bool filter(QCompassReading *reading) = 0;
};
%End
%If (Qt_6_2_0 -)
class QCompass : public QSensor
{
%TypeHeaderCode
#include <qcompass.h>
%End
public:
explicit QCompass(QObject *parent /TransferThis/ = 0);
virtual ~QCompass();
QCompassReading *reading() const;
};
%End

View File

@@ -0,0 +1,68 @@
// qgyroscope.sip generated by MetaSIP
//
// This file is part of the QtSensors Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_6_2_0 -)
class QGyroscopeReading : public QSensorReading /NoDefaultCtors/
{
%TypeHeaderCode
#include <qgyroscope.h>
%End
public:
qreal x() const;
void setX(qreal x);
qreal y() const;
void setY(qreal y);
qreal z() const;
void setZ(qreal z);
};
%End
%If (Qt_6_2_0 -)
class QGyroscopeFilter : public QSensorFilter
{
%TypeHeaderCode
#include <qgyroscope.h>
%End
public:
virtual bool filter(QGyroscopeReading *reading) = 0;
};
%End
%If (Qt_6_2_0 -)
class QGyroscope : public QSensor
{
%TypeHeaderCode
#include <qgyroscope.h>
%End
public:
explicit QGyroscope(QObject *parent /TransferThis/ = 0);
virtual ~QGyroscope();
QGyroscopeReading *reading() const;
};
%End

View File

@@ -0,0 +1,66 @@
// qhumiditysensor.sip generated by MetaSIP
//
// This file is part of the QtSensors Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_6_2_0 -)
class QHumidityReading : public QSensorReading /NoDefaultCtors/
{
%TypeHeaderCode
#include <qhumiditysensor.h>
%End
public:
qreal relativeHumidity() const;
void setRelativeHumidity(qreal percent);
qreal absoluteHumidity() const;
void setAbsoluteHumidity(qreal value);
};
%End
%If (Qt_6_2_0 -)
class QHumidityFilter : public QSensorFilter
{
%TypeHeaderCode
#include <qhumiditysensor.h>
%End
public:
virtual bool filter(QHumidityReading *reading) = 0;
};
%End
%If (Qt_6_2_0 -)
class QHumiditySensor : public QSensor
{
%TypeHeaderCode
#include <qhumiditysensor.h>
%End
public:
explicit QHumiditySensor(QObject *parent /TransferThis/ = 0);
virtual ~QHumiditySensor();
QHumidityReading *reading() const;
};
%End

View File

@@ -0,0 +1,64 @@
// qirproximitysensor.sip generated by MetaSIP
//
// This file is part of the QtSensors Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_6_2_0 -)
class QIRProximityReading : public QSensorReading /NoDefaultCtors/
{
%TypeHeaderCode
#include <qirproximitysensor.h>
%End
public:
qreal reflectance() const;
void setReflectance(qreal reflectance);
};
%End
%If (Qt_6_2_0 -)
class QIRProximityFilter : public QSensorFilter
{
%TypeHeaderCode
#include <qirproximitysensor.h>
%End
public:
virtual bool filter(QIRProximityReading *reading) = 0;
};
%End
%If (Qt_6_2_0 -)
class QIRProximitySensor : public QSensor
{
%TypeHeaderCode
#include <qirproximitysensor.h>
%End
public:
explicit QIRProximitySensor(QObject *parent /TransferThis/ = 0);
virtual ~QIRProximitySensor();
QIRProximityReading *reading() const;
};
%End

View File

@@ -0,0 +1,70 @@
// qlidsensor.sip generated by MetaSIP
//
// This file is part of the QtSensors Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_6_2_0 -)
class QLidReading : public QSensorReading /NoDefaultCtors/
{
%TypeHeaderCode
#include <qlidsensor.h>
%End
public:
bool backLidClosed() const;
void setBackLidClosed(bool closed);
bool frontLidClosed() const;
void setFrontLidClosed(bool closed);
signals:
void backLidChanged(bool closed);
void frontLidChanged(bool closed);
};
%End
%If (Qt_6_2_0 -)
class QLidFilter : public QSensorFilter
{
%TypeHeaderCode
#include <qlidsensor.h>
%End
public:
virtual bool filter(QLidReading *reading) = 0;
};
%End
%If (Qt_6_2_0 -)
class QLidSensor : public QSensor
{
%TypeHeaderCode
#include <qlidsensor.h>
%End
public:
explicit QLidSensor(QObject *parent /TransferThis/ = 0);
virtual ~QLidSensor();
QLidReading *reading() const;
};
%End

View File

@@ -0,0 +1,69 @@
// qlightsensor.sip generated by MetaSIP
//
// This file is part of the QtSensors Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_6_2_0 -)
class QLightReading : public QSensorReading /NoDefaultCtors/
{
%TypeHeaderCode
#include <qlightsensor.h>
%End
public:
qreal lux() const;
void setLux(qreal lux);
};
%End
%If (Qt_6_2_0 -)
class QLightFilter : public QSensorFilter
{
%TypeHeaderCode
#include <qlightsensor.h>
%End
public:
virtual bool filter(QLightReading *reading) = 0;
};
%End
%If (Qt_6_2_0 -)
class QLightSensor : public QSensor
{
%TypeHeaderCode
#include <qlightsensor.h>
%End
public:
explicit QLightSensor(QObject *parent /TransferThis/ = 0);
virtual ~QLightSensor();
QLightReading *reading() const;
qreal fieldOfView() const;
void setFieldOfView(qreal fieldOfView);
signals:
void fieldOfViewChanged(qreal fieldOfView);
};
%End

View File

@@ -0,0 +1,75 @@
// qmagnetometer.sip generated by MetaSIP
//
// This file is part of the QtSensors Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_6_2_0 -)
class QMagnetometerReading : public QSensorReading /NoDefaultCtors/
{
%TypeHeaderCode
#include <qmagnetometer.h>
%End
public:
qreal x() const;
void setX(qreal x);
qreal y() const;
void setY(qreal y);
qreal z() const;
void setZ(qreal z);
qreal calibrationLevel() const;
void setCalibrationLevel(qreal calibrationLevel);
};
%End
%If (Qt_6_2_0 -)
class QMagnetometerFilter : public QSensorFilter
{
%TypeHeaderCode
#include <qmagnetometer.h>
%End
public:
virtual bool filter(QMagnetometerReading *reading) = 0;
};
%End
%If (Qt_6_2_0 -)
class QMagnetometer : public QSensor
{
%TypeHeaderCode
#include <qmagnetometer.h>
%End
public:
explicit QMagnetometer(QObject *parent /TransferThis/ = 0);
virtual ~QMagnetometer();
QMagnetometerReading *reading() const;
bool returnGeoValues() const;
void setReturnGeoValues(bool returnGeoValues);
signals:
void returnGeoValuesChanged(bool returnGeoValues);
};
%End

View File

@@ -0,0 +1,75 @@
// qorientationsensor.sip generated by MetaSIP
//
// This file is part of the QtSensors Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_6_2_0 -)
class QOrientationReading : public QSensorReading /NoDefaultCtors/
{
%TypeHeaderCode
#include <qorientationsensor.h>
%End
public:
enum Orientation
{
Undefined,
TopUp,
TopDown,
LeftUp,
RightUp,
FaceUp,
FaceDown,
};
QOrientationReading::Orientation orientation() const;
void setOrientation(QOrientationReading::Orientation orientation);
};
%End
%If (Qt_6_2_0 -)
class QOrientationFilter : public QSensorFilter
{
%TypeHeaderCode
#include <qorientationsensor.h>
%End
public:
virtual bool filter(QOrientationReading *reading) = 0;
};
%End
%If (Qt_6_2_0 -)
class QOrientationSensor : public QSensor
{
%TypeHeaderCode
#include <qorientationsensor.h>
%End
public:
explicit QOrientationSensor(QObject *parent /TransferThis/ = 0);
virtual ~QOrientationSensor();
QOrientationReading *reading() const;
};
%End

View File

@@ -0,0 +1,66 @@
// qpressuresensor.sip generated by MetaSIP
//
// This file is part of the QtSensors Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_6_2_0 -)
class QPressureReading : public QSensorReading /NoDefaultCtors/
{
%TypeHeaderCode
#include <qpressuresensor.h>
%End
public:
qreal pressure() const;
void setPressure(qreal pressure);
qreal temperature() const;
void setTemperature(qreal temperature);
};
%End
%If (Qt_6_2_0 -)
class QPressureFilter : public QSensorFilter
{
%TypeHeaderCode
#include <qpressuresensor.h>
%End
public:
virtual bool filter(QPressureReading *reading) = 0;
};
%End
%If (Qt_6_2_0 -)
class QPressureSensor : public QSensor
{
%TypeHeaderCode
#include <qpressuresensor.h>
%End
public:
explicit QPressureSensor(QObject *parent /TransferThis/ = 0);
virtual ~QPressureSensor();
QPressureReading *reading() const;
};
%End

View File

@@ -0,0 +1,64 @@
// qproximitysensor.sip generated by MetaSIP
//
// This file is part of the QtSensors Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_6_2_0 -)
class QProximityReading : public QSensorReading /NoDefaultCtors/
{
%TypeHeaderCode
#include <qproximitysensor.h>
%End
public:
bool close() const;
void setClose(bool close);
};
%End
%If (Qt_6_2_0 -)
class QProximityFilter : public QSensorFilter
{
%TypeHeaderCode
#include <qproximitysensor.h>
%End
public:
virtual bool filter(QProximityReading *reading) = 0;
};
%End
%If (Qt_6_2_0 -)
class QProximitySensor : public QSensor
{
%TypeHeaderCode
#include <qproximitysensor.h>
%End
public:
explicit QProximitySensor(QObject *parent /TransferThis/ = 0);
virtual ~QProximitySensor();
QProximityReading *reading() const;
};
%End

View File

@@ -0,0 +1,71 @@
// qrotationsensor.sip generated by MetaSIP
//
// This file is part of the QtSensors Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_6_2_0 -)
class QRotationReading : public QSensorReading /NoDefaultCtors/
{
%TypeHeaderCode
#include <qrotationsensor.h>
%End
public:
qreal x() const;
qreal y() const;
qreal z() const;
void setFromEuler(qreal x, qreal y, qreal z);
};
%End
%If (Qt_6_2_0 -)
class QRotationFilter : public QSensorFilter
{
%TypeHeaderCode
#include <qrotationsensor.h>
%End
public:
virtual bool filter(QRotationReading *reading) = 0;
};
%End
%If (Qt_6_2_0 -)
class QRotationSensor : public QSensor
{
%TypeHeaderCode
#include <qrotationsensor.h>
%End
public:
explicit QRotationSensor(QObject *parent /TransferThis/ = 0);
virtual ~QRotationSensor();
QRotationReading *reading() const;
bool hasZ() const;
void setHasZ(bool hasZ);
signals:
void hasZChanged(bool hasZ);
};
%End

View File

@@ -0,0 +1,234 @@
// qsensor.sip generated by MetaSIP
//
// This file is part of the QtSensors Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_6_2_0 -)
struct qoutputrange
{
%TypeHeaderCode
#include <qsensor.h>
%End
qreal minimum;
qreal maximum;
qreal accuracy;
};
%End
%If (Qt_6_2_0 -)
typedef QList<qoutputrange> qoutputrangelist;
%End
%If (Qt_6_2_0 -)
class QSensorReading : public QObject /NoDefaultCtors/
{
%TypeHeaderCode
#include <qsensor.h>
%End
public:
virtual ~QSensorReading();
quint64 timestamp() const;
void setTimestamp(quint64 timestamp);
int valueCount() const;
QVariant value(int index) const;
};
%End
%If (Qt_6_2_0 -)
class QSensorFilter
{
%TypeHeaderCode
#include <qsensor.h>
%End
public:
virtual bool filter(QSensorReading *reading) = 0;
protected:
QSensorFilter();
virtual ~QSensorFilter();
};
%End
%If (Qt_6_2_0 -)
class QSensor : public QObject
{
%TypeHeaderCode
#include <qsensor.h>
%End
%ConvertToSubClassCode
static struct class_graph {
const char *name;
sipTypeDef **type;
int yes, no;
} graph[] = {
{sipName_QSensor, &sipType_QSensor, 2, 1},
{sipName_QSensorReading, &sipType_QSensorReading, 18, -1},
{sipName_QAccelerometer, &sipType_QAccelerometer, -1, 3},
{sipName_QAmbientLightSensor, &sipType_QAmbientLightSensor, -1, 4},
{sipName_QAmbientTemperatureSensor, &sipType_QAmbientTemperatureSensor, -1, 5},
{sipName_QCompass, &sipType_QCompass, -1, 6},
{sipName_QGyroscope, &sipType_QGyroscope, -1, 7},
{sipName_QHumiditySensor, &sipType_QHumiditySensor, -1, 8},
{sipName_QIRProximitySensor, &sipType_QIRProximitySensor, -1, 9},
{sipName_QLidSensor, &sipType_QLidSensor, -1, 10},
{sipName_QLightSensor, &sipType_QLightSensor, -1, 11},
{sipName_QMagnetometer, &sipType_QMagnetometer, -1, 12},
{sipName_QOrientationSensor, &sipType_QOrientationSensor, -1, 13},
{sipName_QPressureSensor, &sipType_QPressureSensor, -1, 14},
{sipName_QProximitySensor, &sipType_QProximitySensor, -1, 15},
{sipName_QRotationSensor, &sipType_QRotationSensor, -1, 16},
{sipName_QTapSensor, &sipType_QTapSensor, -1, 17},
{sipName_QTiltSensor, &sipType_QTiltSensor, -1, -1},
{sipName_QAccelerometerReading, &sipType_QAccelerometerReading, -1, 19},
{sipName_QAmbientLightReading, &sipType_QAmbientLightReading, -1, 20},
{sipName_QAmbientTemperatureReading, &sipType_QAmbientTemperatureReading, -1, 21},
{sipName_QCompassReading, &sipType_QCompassReading, -1, 22},
{sipName_QGyroscopeReading, &sipType_QGyroscopeReading, -1, 23},
{sipName_QHumidityReading, &sipType_QHumidityReading, -1, 24},
{sipName_QIRProximityReading, &sipType_QIRProximityReading, -1, 25},
{sipName_QLidReading, &sipType_QLidReading, -1, 26},
{sipName_QLightReading, &sipType_QLightReading, -1, 27},
{sipName_QMagnetometerReading, &sipType_QMagnetometerReading, -1, 28},
{sipName_QOrientationReading, &sipType_QOrientationReading, -1, 29},
{sipName_QPressureReading, &sipType_QPressureReading, -1, 30},
{sipName_QProximityReading, &sipType_QProximityReading, -1, 31},
{sipName_QRotationReading, &sipType_QRotationReading, -1, 32},
{sipName_QTapReading, &sipType_QTapReading, -1, 33},
{sipName_QTiltReading, &sipType_QTiltReading, -1, -1},
};
int i = 0;
sipType = NULL;
do
{
struct class_graph *cg = &graph[i];
if (cg->name != NULL && sipCpp->inherits(cg->name))
{
sipType = *cg->type;
i = cg->yes;
}
else
i = cg->no;
}
while (i >= 0);
%End
public:
enum Feature
{
Buffering,
AlwaysOn,
GeoValues,
FieldOfView,
AccelerationMode,
SkipDuplicates,
AxesOrientation,
PressureSensorTemperature,
};
enum AxesOrientationMode
{
FixedOrientation,
AutomaticOrientation,
UserOrientation,
};
QSensor(const QByteArray &type, QObject *parent /TransferThis/ = 0);
virtual ~QSensor();
QByteArray identifier() const;
void setIdentifier(const QByteArray &identifier);
QByteArray type() const;
bool connectToBackend();
bool isConnectedToBackend() const;
bool isBusy() const;
void setActive(bool active);
bool isActive() const;
bool isAlwaysOn() const;
void setAlwaysOn(bool alwaysOn);
bool skipDuplicates() const;
void setSkipDuplicates(bool skipDuplicates);
qrangelist availableDataRates() const;
int dataRate() const;
void setDataRate(int rate);
qoutputrangelist outputRanges() const;
int outputRange() const;
void setOutputRange(int index);
QString description() const;
int error() const;
void addFilter(QSensorFilter *filter);
void removeFilter(QSensorFilter *filter);
QList<QSensorFilter *> filters() const;
QSensorReading *reading() const;
static QList<QByteArray> sensorTypes();
static QList<QByteArray> sensorsForType(const QByteArray &type);
static QByteArray defaultSensorForType(const QByteArray &type);
bool isFeatureSupported(QSensor::Feature feature) const;
QSensor::AxesOrientationMode axesOrientationMode() const;
void setAxesOrientationMode(QSensor::AxesOrientationMode axesOrientationMode);
int currentOrientation() const;
void setCurrentOrientation(int currentOrientation);
int userOrientation() const;
void setUserOrientation(int userOrientation);
int maxBufferSize() const;
void setMaxBufferSize(int maxBufferSize);
int efficientBufferSize() const;
void setEfficientBufferSize(int efficientBufferSize);
int bufferSize() const;
void setBufferSize(int bufferSize);
public slots:
bool start();
void stop();
signals:
void busyChanged();
void activeChanged();
void readingChanged();
void sensorError(int error);
void availableSensorsChanged();
void alwaysOnChanged();
void dataRateChanged();
void skipDuplicatesChanged(bool skipDuplicates);
void axesOrientationModeChanged(QSensor::AxesOrientationMode axesOrientationMode /ScopesStripped=1/);
void currentOrientationChanged(int currentOrientation);
void userOrientationChanged(int userOrientation);
void maxBufferSizeChanged(int maxBufferSize);
void efficientBufferSizeChanged(int efficientBufferSize);
void bufferSizeChanged(int bufferSize);
void identifierChanged();
};
%End
%If (Qt_6_2_0 -)
typedef std::pair<int, int> qrange;
%End
%If (Qt_6_2_0 -)
typedef QList<std::pair<int, int>> qrangelist;
%End

View File

@@ -0,0 +1,88 @@
// qtapsensor.sip generated by MetaSIP
//
// This file is part of the QtSensors Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_6_2_0 -)
class QTapReading : public QSensorReading /NoDefaultCtors/
{
%TypeHeaderCode
#include <qtapsensor.h>
%End
public:
enum TapDirection
{
Undefined,
X,
Y,
Z,
X_Pos,
Y_Pos,
Z_Pos,
X_Neg,
Y_Neg,
Z_Neg,
X_Both,
Y_Both,
Z_Both,
};
QTapReading::TapDirection tapDirection() const;
void setTapDirection(QTapReading::TapDirection tapDirection);
bool isDoubleTap() const;
void setDoubleTap(bool doubleTap);
};
%End
%If (Qt_6_2_0 -)
class QTapFilter : public QSensorFilter
{
%TypeHeaderCode
#include <qtapsensor.h>
%End
public:
virtual bool filter(QTapReading *reading) = 0;
};
%End
%If (Qt_6_2_0 -)
class QTapSensor : public QSensor
{
%TypeHeaderCode
#include <qtapsensor.h>
%End
public:
explicit QTapSensor(QObject *parent /TransferThis/ = 0);
virtual ~QTapSensor();
QTapReading *reading() const;
bool returnDoubleTapEvents() const;
void setReturnDoubleTapEvents(bool returnDoubleTapEvents);
signals:
void returnDoubleTapEventsChanged(bool returnDoubleTapEvents);
};
%End

View File

@@ -0,0 +1,67 @@
// qtiltsensor.sip generated by MetaSIP
//
// This file is part of the QtSensors Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_6_2_0 -)
class QTiltReading : public QSensorReading /NoDefaultCtors/
{
%TypeHeaderCode
#include <qtiltsensor.h>
%End
public:
qreal yRotation() const;
void setYRotation(qreal y);
qreal xRotation() const;
void setXRotation(qreal x);
};
%End
%If (Qt_6_2_0 -)
class QTiltFilter : public QSensorFilter
{
%TypeHeaderCode
#include <qtiltsensor.h>
%End
public:
virtual bool filter(QTiltReading *reading) = 0;
};
%End
%If (Qt_6_2_0 -)
class QTiltSensor : public QSensor
{
%TypeHeaderCode
#include <qtiltsensor.h>
%End
public:
explicit QTiltSensor(QObject *parent /TransferThis/ = 0);
virtual ~QTiltSensor();
QTiltReading *reading() const;
void calibrate();
};
%End