summaryrefslogtreecommitdiffstats
path: root/src/sensors
diff options
context:
space:
mode:
Diffstat (limited to 'src/sensors')
-rw-r--r--src/sensors/qsensor.cpp15
-rw-r--r--src/sensors/qsensor.h2
-rw-r--r--src/sensors/qtapsensor.h2
3 files changed, 9 insertions, 10 deletions
diff --git a/src/sensors/qsensor.cpp b/src/sensors/qsensor.cpp
index 4b8ca2d5..bca6358b 100644
--- a/src/sensors/qsensor.cpp
+++ b/src/sensors/qsensor.cpp
@@ -143,10 +143,13 @@ QT_BEGIN_NAMESPACE
\sa QList, qoutputrange, QSensor::outputRanges
*/
-// A bit of a hack to call qRegisterMetaType when the library is loaded.
-static int qrange_id = qRegisterMetaType<qrange>("qrange");
-static int qrangelist_id = qRegisterMetaType<qrangelist>("qrangelist");
-static int qoutputrangelist_id = qRegisterMetaType<qoutputrangelist>("qoutputrangelist");
+static void registerTypes()
+{
+ qRegisterMetaType<qrange>("qrange");
+ qRegisterMetaType<qrangelist>("qrangelist");
+ qRegisterMetaType<qoutputrangelist>("qoutputrangelist");
+}
+Q_CONSTRUCTOR_FUNCTION(registerTypes)
// =====================================================================
@@ -1039,7 +1042,6 @@ int QSensor::maxBufferSize() const
*/
void QSensor::setMaxBufferSize(int maxBufferSize)
{
- // ### Qt 6: Remove the entire maxBufferSize property, no backend really uses it
Q_D(QSensor);
if (d->maxBufferSize != maxBufferSize) {
d->maxBufferSize = maxBufferSize;
@@ -1070,7 +1072,6 @@ int QSensor::efficientBufferSize() const
*/
void QSensor::setEfficientBufferSize(int efficientBufferSize)
{
- // ### Qt 6: Remove the entire efficientBufferSize property, no backend really uses it
Q_D(QSensor);
if (d->efficientBufferSize != efficientBufferSize) {
d->efficientBufferSize = efficientBufferSize;
@@ -1121,8 +1122,6 @@ int QSensor::bufferSize() const
void QSensor::setBufferSize(int bufferSize)
{
- // ### Qt 6: Currently only the Blackberry backend supports this, but only as an on/off switch.
- // We should consider changing this to a more appropriate API.
Q_D(QSensor);
if (d->bufferSize != bufferSize) {
d->bufferSize = bufferSize;
diff --git a/src/sensors/qsensor.h b/src/sensors/qsensor.h
index 8512d4c6..b83d736b 100644
--- a/src/sensors/qsensor.h
+++ b/src/sensors/qsensor.h
@@ -90,7 +90,7 @@ class Q_SENSORS_EXPORT QSensor : public QObject
Q_PROPERTY(int outputRange READ outputRange WRITE setOutputRange)
Q_PROPERTY(QString description READ description)
Q_PROPERTY(int error READ error NOTIFY sensorError)
- Q_PROPERTY(bool alwaysOn READ isAlwaysOn WRITE setAlwaysOn NOTIFY alwaysOnChanged REVISION 1)
+ Q_PROPERTY(bool alwaysOn READ isAlwaysOn WRITE setAlwaysOn NOTIFY alwaysOnChanged)
Q_PROPERTY(bool skipDuplicates READ skipDuplicates WRITE setSkipDuplicates NOTIFY skipDuplicatesChanged)
Q_PROPERTY(AxesOrientationMode axesOrientationMode READ axesOrientationMode WRITE setAxesOrientationMode NOTIFY axesOrientationModeChanged)
Q_PROPERTY(int currentOrientation READ currentOrientation NOTIFY currentOrientationChanged)
diff --git a/src/sensors/qtapsensor.h b/src/sensors/qtapsensor.h
index 74ca40c2..b8704114 100644
--- a/src/sensors/qtapsensor.h
+++ b/src/sensors/qtapsensor.h
@@ -107,7 +107,7 @@ Q_SIGNALS:
void returnDoubleTapEventsChanged(bool returnDoubleTapEvents);
private:
- Q_DECLARE_PRIVATE(QTapSensor);
+ Q_DECLARE_PRIVATE(QTapSensor)
Q_DISABLE_COPY(QTapSensor)
};