diff options
author | Juha Vuolle <juha.vuolle@insta.fi> | 2021-01-05 14:27:16 +0200 |
---|---|---|
committer | Juha Vuolle <juha.vuolle@insta.fi> | 2021-04-19 13:29:44 +0300 |
commit | 5a8aa096dc61336ac95734e8cc61f106e359c865 (patch) | |
tree | 20b1c3f3932b48bb6020a3d40d0dacf1abc6be2d /src/sensors/qsensor.h | |
parent | 7dbb79c428f813e32986ccfe09a42f7d61a4c005 (diff) |
Base commit to make QtSensors runnable on Windows
Fair amount of work remains after the commit still, but this should
allow further development as a compilable baseline: code compiles,
autotests pass, and most example applications at least start.
The changes:
-Change examples to use QtQuickControls 2 as per removal of v1
-Fix ambiguous conditional expression compilation error
-Link against runtimeobject library (previously part of winrt QPA?)
-Change the .pro file rule to win32 as winrt moniker does not exist anymore
-Remove references to deleted winrt event dispatcher
-Fix error handling: getdefault may be successful even if there is no default sensor
-Fix QCOMPARE failure output (toString has changed in Qt6)
-Remove qtimestamp alias which was deprecated already in Qt5
-Remove unit test hook that does not seem to be used anywhere
-From typedef to ‘using’ for readability
-Q_ENUMS -> Q_ENUM as the former has been obsoleted by the latter
-Add qt6 changes qdoc page
Task-number: QTBUG-88616
Change-Id: I92c168228ba76106b2c636c88f54331c76c3d2e6
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/sensors/qsensor.h')
-rw-r--r-- | src/sensors/qsensor.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/sensors/qsensor.h b/src/sensors/qsensor.h index 7dd7ea19..c988a661 100644 --- a/src/sensors/qsensor.h +++ b/src/sensors/qsensor.h @@ -56,26 +56,22 @@ class QSensorReading; class QSensorReadingPrivate; class QSensorFilter; -// This type is no longer used in the API but third party apps may be using it -typedef quint64 qtimestamp; +using qrange = QPair<int,int>; +using qrangelist = QList<qrange>; -typedef QPair<int,int> qrange; -typedef QList<qrange> qrangelist; struct qoutputrange { qreal minimum; qreal maximum; qreal accuracy; }; -typedef QList<qoutputrange> qoutputrangelist; + +using qoutputrangelist = QList<qoutputrange>; class Q_SENSORS_EXPORT QSensor : public QObject { friend class QSensorBackend; - Q_OBJECT - Q_ENUMS(Feature) - Q_ENUMS(AxesOrientationMode) Q_PROPERTY(QByteArray identifier READ identifier WRITE setIdentifier) Q_PROPERTY(QByteArray type READ type) Q_PROPERTY(bool connectedToBackend READ isConnectedToBackend) @@ -108,6 +104,7 @@ public: PressureSensorTemperature, Reserved = 257 // Make sure at least 2 bytes are used for the enum to avoid breaking BC later }; + Q_ENUM(Feature) // Keep in sync with QmlSensor::AxesOrientationMode enum AxesOrientationMode { @@ -115,6 +112,7 @@ public: AutomaticOrientation, UserOrientation }; + Q_ENUM(AxesOrientationMode) explicit QSensor(const QByteArray &type, QObject *parent = Q_NULLPTR); virtual ~QSensor(); |