summaryrefslogtreecommitdiff
path: root/src/sensors
diff options
context:
space:
mode:
authorThomas McGuire <thomas.mcguire.qnx@kdab.com>2013-04-22 11:34:40 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-06 09:16:24 +0200
commit5b11584bfede4e0787532ec3c9ba763100a8898f (patch)
treea4028959e15d2887a2a4c370a5662c4dddfc055b /src/sensors
parente533f476239ea25edaf8fbfc6e8a76ccfd0ab330 (diff)
downloadqtsensors-5b11584bfede4e0787532ec3c9ba763100a8898f.tar.gz
Fix some potential binary compatibility issues
Mostly de-inlining methods, and in addition providing a virtual destructor. Change-Id: I0aef91e7a896e8a16fc023a11bd35a5ef3048ee6 Reviewed-by: Bernd Weimer <bweimer@blackberry.com> Reviewed-by: Lorn Potter <lorn.potter@jollamobile.com>
Diffstat (limited to 'src/sensors')
-rwxr-xr-xsrc/sensors/make_sensor.pl15
-rw-r--r--src/sensors/qaccelerometer.cpp10
-rw-r--r--src/sensors/qaccelerometer.h4
-rw-r--r--src/sensors/qaltimeter.cpp10
-rw-r--r--src/sensors/qaltimeter.h5
-rw-r--r--src/sensors/qambientlightsensor.cpp10
-rw-r--r--src/sensors/qambientlightsensor.h4
-rw-r--r--src/sensors/qambienttemperaturesensor.cpp10
-rw-r--r--src/sensors/qambienttemperaturesensor.h5
-rw-r--r--src/sensors/qcompass.cpp10
-rw-r--r--src/sensors/qcompass.h4
-rw-r--r--src/sensors/qgyroscope.cpp10
-rw-r--r--src/sensors/qgyroscope.h4
-rw-r--r--src/sensors/qholstersensor.cpp10
-rw-r--r--src/sensors/qholstersensor.h5
-rw-r--r--src/sensors/qirproximitysensor.cpp9
-rw-r--r--src/sensors/qirproximitysensor.h4
-rw-r--r--src/sensors/qlightsensor.cpp10
-rw-r--r--src/sensors/qlightsensor.h4
-rw-r--r--src/sensors/qmagnetometer.cpp10
-rw-r--r--src/sensors/qmagnetometer.h4
-rw-r--r--src/sensors/qorientationsensor.cpp10
-rw-r--r--src/sensors/qorientationsensor.h4
-rw-r--r--src/sensors/qpressuresensor.cpp10
-rw-r--r--src/sensors/qpressuresensor.h5
-rw-r--r--src/sensors/qproximitysensor.cpp10
-rw-r--r--src/sensors/qproximitysensor.h4
-rw-r--r--src/sensors/qrotationsensor.cpp10
-rw-r--r--src/sensors/qrotationsensor.h4
-rw-r--r--src/sensors/qsensorbackend.cpp6
-rw-r--r--src/sensors/qsensorbackend.h2
-rw-r--r--src/sensors/qsensormanager.cpp4
-rw-r--r--src/sensors/qsensormanager.h2
-rw-r--r--src/sensors/qsensorplugin.cpp9
-rw-r--r--src/sensors/qsensorplugin.h4
-rw-r--r--src/sensors/qtapsensor.cpp10
-rw-r--r--src/sensors/qtapsensor.h4
-rw-r--r--src/sensors/qtiltsensor.cpp9
-rw-r--r--src/sensors/qtiltsensor.h4
39 files changed, 220 insertions, 48 deletions
diff --git a/src/sensors/make_sensor.pl b/src/sensors/make_sensor.pl
index 2732251..00afa72 100755
--- a/src/sensors/make_sensor.pl
+++ b/src/sensors/make_sensor.pl
@@ -315,8 +315,7 @@ class Q_SENSORS_EXPORT '.$filter.' : public QSensorFilter
public:
virtual bool filter('.$reading.' *reading) = 0;
private:
- bool filter(QSensorReading *reading) Q_DECL_OVERRIDE
- { return filter(static_cast<'.$reading.'*>(reading)); }
+ bool filter(QSensorReading *reading) Q_DECL_OVERRIDE;
};
class Q_SENSORS_EXPORT '.$sensor.' : public QSensor
@@ -325,7 +324,7 @@ class Q_SENSORS_EXPORT '.$sensor.' : public QSensor
public:
explicit '.$sensor.'(QObject *parent = 0);
~'.$sensor.'();
- '.$reading.' *reading() const { return static_cast<'.$reading.'*>(QSensor::reading()); }
+ '.$reading.' *reading() const;
static char const * const type;
private:
@@ -408,6 +407,11 @@ void '.$reading.'::setMyprop(qreal myprop)
\sa QSensorFilter::filter()
*/
+bool '.$filter.'::filter(QSensorReading *reading)
+{
+ return filter(static_cast<'.$reading.'*>(reading));
+}
+
char const * const '.$sensor.'::type("'.$sensor.'");
/*!
@@ -450,6 +454,11 @@ char const * const '.$sensor.'::type("'.$sensor.'");
\sa QSensor::reading()
*/
+'.$reading.' *'.$sensor.'::reading() const
+{
+ return static_cast<'.$reading.'*>(QSensor::reading());
+}
+
#include "moc_'.$source.'"
QT_END_NAMESPACE
';
diff --git a/src/sensors/qaccelerometer.cpp b/src/sensors/qaccelerometer.cpp
index 9b9bd34..dd82273 100644
--- a/src/sensors/qaccelerometer.cpp
+++ b/src/sensors/qaccelerometer.cpp
@@ -150,6 +150,11 @@ void QAccelerometerReading::setZ(qreal z)
\sa QSensorFilter::filter()
*/
+bool QAccelerometerFilter::filter(QSensorReading *reading)
+{
+ return filter(static_cast<QAccelerometerReading*>(reading));
+}
+
char const * const QAccelerometer::type("QAccelerometer");
/*!
@@ -257,6 +262,11 @@ void QAccelerometer::setAccelerationMode(QAccelerometer::AccelerationMode accele
\sa QSensor::reading()
*/
+QAccelerometerReading *QAccelerometer::reading() const
+{
+ return static_cast<QAccelerometerReading*>(QSensor::reading());
+}
+
/*!
\fn QAccelerometer::accelerationModeChanged(AccelerationMode accelerationMode)
diff --git a/src/sensors/qaccelerometer.h b/src/sensors/qaccelerometer.h
index 4478235..b9be052 100644
--- a/src/sensors/qaccelerometer.h
+++ b/src/sensors/qaccelerometer.h
@@ -71,7 +71,7 @@ class Q_SENSORS_EXPORT QAccelerometerFilter : public QSensorFilter
public:
virtual bool filter(QAccelerometerReading *reading) = 0;
private:
- bool filter(QSensorReading *reading) { return filter(static_cast<QAccelerometerReading*>(reading)); }
+ bool filter(QSensorReading *reading);
};
class QAccelerometerPrivate;
@@ -96,7 +96,7 @@ public:
AccelerationMode accelerationMode() const;
void setAccelerationMode(AccelerationMode accelerationMode);
- QAccelerometerReading *reading() const { return static_cast<QAccelerometerReading*>(QSensor::reading()); }
+ QAccelerometerReading *reading() const;
static char const * const type;
Q_SIGNALS:
diff --git a/src/sensors/qaltimeter.cpp b/src/sensors/qaltimeter.cpp
index 6a7caa7..44c5767 100644
--- a/src/sensors/qaltimeter.cpp
+++ b/src/sensors/qaltimeter.cpp
@@ -102,6 +102,11 @@ void QAltimeterReading::setAltitude(qreal altitude)
\sa QSensorFilter::filter()
*/
+bool QAltimeterFilter::filter(QSensorReading *reading)
+{
+ return filter(static_cast<QAltimeterReading*>(reading));
+}
+
char const * const QAltimeter::type("QAltimeter");
/*!
@@ -144,5 +149,10 @@ QAltimeter::~QAltimeter()
\sa QSensor::reading()
*/
+QAltimeterReading *QAltimeter::reading() const
+{
+ return static_cast<QAltimeterReading*>(QSensor::reading());
+}
+
#include "moc_qaltimeter.cpp"
QT_END_NAMESPACE
diff --git a/src/sensors/qaltimeter.h b/src/sensors/qaltimeter.h
index 6b7d223..7077e38 100644
--- a/src/sensors/qaltimeter.h
+++ b/src/sensors/qaltimeter.h
@@ -62,8 +62,7 @@ class Q_SENSORS_EXPORT QAltimeterFilter : public QSensorFilter
public:
virtual bool filter(QAltimeterReading *reading) = 0;
private:
- bool filter(QSensorReading *reading) Q_DECL_OVERRIDE
- { return filter(static_cast<QAltimeterReading*>(reading)); }
+ bool filter(QSensorReading *reading) Q_DECL_OVERRIDE;
};
class Q_SENSORS_EXPORT QAltimeter : public QSensor
@@ -72,7 +71,7 @@ class Q_SENSORS_EXPORT QAltimeter : public QSensor
public:
explicit QAltimeter(QObject *parent = 0);
~QAltimeter();
- QAltimeterReading *reading() const { return static_cast<QAltimeterReading*>(QSensor::reading()); }
+ QAltimeterReading *reading() const;
static char const * const type;
private:
diff --git a/src/sensors/qambientlightsensor.cpp b/src/sensors/qambientlightsensor.cpp
index 2c434b4..6992459 100644
--- a/src/sensors/qambientlightsensor.cpp
+++ b/src/sensors/qambientlightsensor.cpp
@@ -126,6 +126,11 @@ void QAmbientLightReading::setLightLevel(QAmbientLightReading::LightLevel lightL
\sa QSensorFilter::filter()
*/
+bool QAmbientLightFilter::filter(QSensorReading *reading)
+{
+ return filter(static_cast<QAmbientLightReading*>(reading));
+}
+
char const * const QAmbientLightSensor::type("QAmbientLightSensor");
/*!
@@ -167,6 +172,11 @@ QAmbientLightSensor::~QAmbientLightSensor()
\sa QSensor::reading()
*/
+QAmbientLightReading *QAmbientLightSensor::reading() const
+{
+ return static_cast<QAmbientLightReading*>(QSensor::reading());
+}
+
#include "moc_qambientlightsensor.cpp"
QT_END_NAMESPACE
diff --git a/src/sensors/qambientlightsensor.h b/src/sensors/qambientlightsensor.h
index 3dae639..8f9ee50 100644
--- a/src/sensors/qambientlightsensor.h
+++ b/src/sensors/qambientlightsensor.h
@@ -73,7 +73,7 @@ class Q_SENSORS_EXPORT QAmbientLightFilter : public QSensorFilter
public:
virtual bool filter(QAmbientLightReading *reading) = 0;
private:
- bool filter(QSensorReading *reading) { return filter(static_cast<QAmbientLightReading*>(reading)); }
+ bool filter(QSensorReading *reading);
};
class Q_SENSORS_EXPORT QAmbientLightSensor : public QSensor
@@ -82,7 +82,7 @@ class Q_SENSORS_EXPORT QAmbientLightSensor : public QSensor
public:
explicit QAmbientLightSensor(QObject *parent = 0);
virtual ~QAmbientLightSensor();
- QAmbientLightReading *reading() const { return static_cast<QAmbientLightReading*>(QSensor::reading()); }
+ QAmbientLightReading *reading() const;
static char const * const type;
private:
diff --git a/src/sensors/qambienttemperaturesensor.cpp b/src/sensors/qambienttemperaturesensor.cpp
index 9ecde6d..7dd34dd 100644
--- a/src/sensors/qambienttemperaturesensor.cpp
+++ b/src/sensors/qambienttemperaturesensor.cpp
@@ -98,6 +98,11 @@ void QAmbientTemperatureReading::setTemperature(qreal temperature)
\sa QSensorFilter::filter()
*/
+bool QAmbientTemperatureFilter::filter(QSensorReading *reading)
+{
+ return filter(static_cast<QAmbientTemperatureReading*>(reading));
+}
+
char const * const QAmbientTemperatureSensor::type("QAmbientTemperatureSensor");
/*!
@@ -140,5 +145,10 @@ QAmbientTemperatureSensor::~QAmbientTemperatureSensor()
\sa QSensor::reading()
*/
+QAmbientTemperatureReading *QAmbientTemperatureSensor::reading() const
+{
+ return static_cast<QAmbientTemperatureReading*>(QSensor::reading());
+}
+
#include "moc_qambienttemperaturesensor.cpp"
QT_END_NAMESPACE
diff --git a/src/sensors/qambienttemperaturesensor.h b/src/sensors/qambienttemperaturesensor.h
index 134e5a9..c91392d 100644
--- a/src/sensors/qambienttemperaturesensor.h
+++ b/src/sensors/qambienttemperaturesensor.h
@@ -62,8 +62,7 @@ class Q_SENSORS_EXPORT QAmbientTemperatureFilter : public QSensorFilter
public:
virtual bool filter(QAmbientTemperatureReading *reading) = 0;
private:
- bool filter(QSensorReading *reading) Q_DECL_OVERRIDE
- { return filter(static_cast<QAmbientTemperatureReading*>(reading)); }
+ bool filter(QSensorReading *reading) Q_DECL_OVERRIDE;
};
class Q_SENSORS_EXPORT QAmbientTemperatureSensor : public QSensor
@@ -72,7 +71,7 @@ class Q_SENSORS_EXPORT QAmbientTemperatureSensor : public QSensor
public:
explicit QAmbientTemperatureSensor(QObject *parent = 0);
~QAmbientTemperatureSensor();
- QAmbientTemperatureReading *reading() const { return static_cast<QAmbientTemperatureReading*>(QSensor::reading()); }
+ QAmbientTemperatureReading *reading() const;
static char const * const type;
private:
diff --git a/src/sensors/qcompass.cpp b/src/sensors/qcompass.cpp
index e0592ef..8bfca07 100644
--- a/src/sensors/qcompass.cpp
+++ b/src/sensors/qcompass.cpp
@@ -136,6 +136,11 @@ void QCompassReading::setCalibrationLevel(qreal calibrationLevel)
\sa QSensorFilter::filter()
*/
+bool QCompassFilter::filter(QSensorReading *reading)
+{
+ return filter(static_cast<QCompassReading*>(reading));
+}
+
char const * const QCompass::type("QCompass");
/*!
@@ -177,6 +182,11 @@ QCompass::~QCompass()
\sa QSensor::reading()
*/
+QCompassReading *QCompass::reading() const
+{
+ return static_cast<QCompassReading*>(QSensor::reading());
+}
+
#include "moc_qcompass.cpp"
QT_END_NAMESPACE
diff --git a/src/sensors/qcompass.h b/src/sensors/qcompass.h
index 8b858ff..75b6869 100644
--- a/src/sensors/qcompass.h
+++ b/src/sensors/qcompass.h
@@ -67,7 +67,7 @@ class Q_SENSORS_EXPORT QCompassFilter : public QSensorFilter
public:
virtual bool filter(QCompassReading *reading) = 0;
private:
- bool filter(QSensorReading *reading) { return filter(static_cast<QCompassReading*>(reading)); }
+ bool filter(QSensorReading *reading);
};
class Q_SENSORS_EXPORT QCompass : public QSensor
@@ -76,7 +76,7 @@ class Q_SENSORS_EXPORT QCompass : public QSensor
public:
explicit QCompass(QObject *parent = 0);
virtual ~QCompass();
- QCompassReading *reading() const { return static_cast<QCompassReading*>(QSensor::reading()); }
+ QCompassReading *reading() const;
static char const * const type;
private:
diff --git a/src/sensors/qgyroscope.cpp b/src/sensors/qgyroscope.cpp
index a2dfff8..ca370ba 100644
--- a/src/sensors/qgyroscope.cpp
+++ b/src/sensors/qgyroscope.cpp
@@ -148,6 +148,11 @@ void QGyroscopeReading::setZ(qreal z)
\sa QSensorFilter::filter()
*/
+bool QGyroscopeFilter::filter(QSensorReading *reading)
+{
+ return filter(static_cast<QGyroscopeReading*>(reading));
+}
+
char const * const QGyroscope::type("QGyroscope");
/*!
@@ -189,6 +194,11 @@ QGyroscope::~QGyroscope()
\sa QSensor::reading()
*/
+QGyroscopeReading *QGyroscope::reading() const
+{
+ return static_cast<QGyroscopeReading*>(QSensor::reading());
+}
+
#include "moc_qgyroscope.cpp"
QT_END_NAMESPACE
diff --git a/src/sensors/qgyroscope.h b/src/sensors/qgyroscope.h
index 32c01da..31ed23b 100644
--- a/src/sensors/qgyroscope.h
+++ b/src/sensors/qgyroscope.h
@@ -71,7 +71,7 @@ class Q_SENSORS_EXPORT QGyroscopeFilter : public QSensorFilter
public:
virtual bool filter(QGyroscopeReading *reading) = 0;
private:
- bool filter(QSensorReading *reading) { return filter(static_cast<QGyroscopeReading*>(reading)); }
+ bool filter(QSensorReading *reading);
};
class Q_SENSORS_EXPORT QGyroscope : public QSensor
@@ -80,7 +80,7 @@ class Q_SENSORS_EXPORT QGyroscope : public QSensor
public:
explicit QGyroscope(QObject *parent = 0);
virtual ~QGyroscope();
- QGyroscopeReading *reading() const { return static_cast<QGyroscopeReading*>(QSensor::reading()); }
+ QGyroscopeReading *reading() const;
static char const * const type;
private:
diff --git a/src/sensors/qholstersensor.cpp b/src/sensors/qholstersensor.cpp
index 761910f..648afa3 100644
--- a/src/sensors/qholstersensor.cpp
+++ b/src/sensors/qholstersensor.cpp
@@ -102,6 +102,11 @@ void QHolsterReading::setHolstered(bool holstered)
\sa QSensorFilter::filter()
*/
+bool QHolsterFilter::filter(QSensorReading *reading)
+{
+ return filter(static_cast<QHolsterReading*>(reading));
+}
+
char const * const QHolsterSensor::type("QHolsterSensor");
/*!
@@ -144,5 +149,10 @@ QHolsterSensor::~QHolsterSensor()
\sa QSensor::reading()
*/
+QHolsterReading *QHolsterSensor::reading() const
+{
+ return static_cast<QHolsterReading*>(QSensor::reading());
+}
+
#include "moc_qholstersensor.cpp"
QT_END_NAMESPACE
diff --git a/src/sensors/qholstersensor.h b/src/sensors/qholstersensor.h
index f44b381..85faa17 100644
--- a/src/sensors/qholstersensor.h
+++ b/src/sensors/qholstersensor.h
@@ -62,8 +62,7 @@ class Q_SENSORS_EXPORT QHolsterFilter : public QSensorFilter
public:
virtual bool filter(QHolsterReading *reading) = 0;
private:
- bool filter(QSensorReading *reading) Q_DECL_OVERRIDE
- { return filter(static_cast<QHolsterReading*>(reading)); }
+ bool filter(QSensorReading *reading) Q_DECL_OVERRIDE;
};
class Q_SENSORS_EXPORT QHolsterSensor : public QSensor
@@ -72,7 +71,7 @@ class Q_SENSORS_EXPORT QHolsterSensor : public QSensor
public:
explicit QHolsterSensor(QObject *parent = 0);
~QHolsterSensor();
- QHolsterReading *reading() const { return static_cast<QHolsterReading*>(QSensor::reading()); }
+ QHolsterReading *reading() const;
static char const * const type;
private:
diff --git a/src/sensors/qirproximitysensor.cpp b/src/sensors/qirproximitysensor.cpp
index 6197bb9..81ef909 100644
--- a/src/sensors/qirproximitysensor.cpp
+++ b/src/sensors/qirproximitysensor.cpp
@@ -114,6 +114,11 @@ void QIRProximityReading::setReflectance(qreal reflectance)
\sa QSensorFilter::filter()
*/
+bool QIRProximityFilter::filter(QSensorReading *reading)
+{
+ return filter(static_cast<QIRProximityReading*>(reading));
+}
+
char const * const QIRProximitySensor::type("QIRProximitySensor");
/*!
@@ -155,5 +160,9 @@ QIRProximitySensor::~QIRProximitySensor()
\sa QSensor::reading()
*/
+QIRProximityReading *QIRProximitySensor::reading() const
+{
+ return static_cast<QIRProximityReading*>(QSensor::reading());
+}
#include "moc_qirproximitysensor.cpp"
diff --git a/src/sensors/qirproximitysensor.h b/src/sensors/qirproximitysensor.h
index 29eb49c..c4ecba4 100644
--- a/src/sensors/qirproximitysensor.h
+++ b/src/sensors/qirproximitysensor.h
@@ -63,7 +63,7 @@ class Q_SENSORS_EXPORT QIRProximityFilter : public QSensorFilter
public:
virtual bool filter(QIRProximityReading *reading) = 0;
private:
- bool filter(QSensorReading *reading) { return filter(static_cast<QIRProximityReading*>(reading)); }
+ bool filter(QSensorReading *reading);
};
class Q_SENSORS_EXPORT QIRProximitySensor : public QSensor
@@ -72,7 +72,7 @@ class Q_SENSORS_EXPORT QIRProximitySensor : public QSensor
public:
explicit QIRProximitySensor(QObject *parent = 0);
virtual ~QIRProximitySensor();
- QIRProximityReading *reading() const { return static_cast<QIRProximityReading*>(QSensor::reading()); }
+ QIRProximityReading *reading() const;
static char const * const type;
private:
diff --git a/src/sensors/qlightsensor.cpp b/src/sensors/qlightsensor.cpp
index 1e80ef0..7e10f0f 100644
--- a/src/sensors/qlightsensor.cpp
+++ b/src/sensors/qlightsensor.cpp
@@ -100,6 +100,11 @@ void QLightReading::setLux(qreal lux)
\sa QSensorFilter::filter()
*/
+bool QLightFilter::filter(QSensorReading *reading)
+{
+ return filter(static_cast<QLightReading*>(reading));
+}
+
char const * const QLightSensor::type("QLightSensor");
/*!
@@ -141,6 +146,11 @@ QLightSensor::~QLightSensor()
\sa QSensor::reading()
*/
+QLightReading *QLightSensor::reading() const
+{
+ return static_cast<QLightReading*>(QSensor::reading());
+}
+
/*!
\property QLightSensor::fieldOfView
\brief a value indicating the field of view.
diff --git a/src/sensors/qlightsensor.h b/src/sensors/qlightsensor.h
index 1da8449..26240b4 100644
--- a/src/sensors/qlightsensor.h
+++ b/src/sensors/qlightsensor.h
@@ -63,7 +63,7 @@ class Q_SENSORS_EXPORT QLightFilter : public QSensorFilter
public:
virtual bool filter(QLightReading *reading) = 0;
private:
- bool filter(QSensorReading *reading) { return filter(static_cast<QLightReading*>(reading)); }
+ bool filter(QSensorReading *reading);
};
class QLightSensorPrivate;
@@ -75,7 +75,7 @@ class Q_SENSORS_EXPORT QLightSensor : public QSensor
public:
explicit QLightSensor(QObject *parent = 0);
virtual ~QLightSensor();
- QLightReading *reading() const { return static_cast<QLightReading*>(QSensor::reading()); }
+ QLightReading *reading() const;
static char const * const type;
qreal fieldOfView() const;
diff --git a/src/sensors/qmagnetometer.cpp b/src/sensors/qmagnetometer.cpp
index 7c5c965..e7cc61c 100644
--- a/src/sensors/qmagnetometer.cpp
+++ b/src/sensors/qmagnetometer.cpp
@@ -188,6 +188,11 @@ void QMagnetometerReading::setCalibrationLevel(qreal calibrationLevel)
\sa QSensorFilter::filter()
*/
+bool QMagnetometerFilter::filter(QSensorReading *reading)
+{
+ return filter(static_cast<QMagnetometerReading*>(reading));
+}
+
char const * const QMagnetometer::type("QMagnetometer");
/*!
@@ -229,6 +234,11 @@ QMagnetometer::~QMagnetometer()
\sa QSensor::reading()
*/
+QMagnetometerReading *QMagnetometer::reading() const
+{
+ return static_cast<QMagnetometerReading*>(QSensor::reading());
+}
+
/*!
\property QMagnetometer::returnGeoValues
\brief a value indicating if geomagnetic values should be returned.
diff --git a/src/sensors/qmagnetometer.h b/src/sensors/qmagnetometer.h
index 93b6157..9d754fc 100644
--- a/src/sensors/qmagnetometer.h
+++ b/src/sensors/qmagnetometer.h
@@ -75,7 +75,7 @@ class Q_SENSORS_EXPORT QMagnetometerFilter : public QSensorFilter
public:
virtual bool filter(QMagnetometerReading *reading) = 0;
private:
- bool filter(QSensorReading *reading) { return filter(static_cast<QMagnetometerReading*>(reading)); }
+ bool filter(QSensorReading *reading);
};
class QMagnetometerPrivate;
@@ -87,7 +87,7 @@ class Q_SENSORS_EXPORT QMagnetometer : public QSensor
public:
explicit QMagnetometer(QObject *parent = 0);
virtual ~QMagnetometer();
- QMagnetometerReading *reading() const { return static_cast<QMagnetometerReading*>(QSensor::reading()); }
+ QMagnetometerReading *reading() const;
static char const * const type;
bool returnGeoValues() const;
diff --git a/src/sensors/qorientationsensor.cpp b/src/sensors/qorientationsensor.cpp
index 0ca545e..5f5015d 100644
--- a/src/sensors/qorientationsensor.cpp
+++ b/src/sensors/qorientationsensor.cpp
@@ -149,6 +149,11 @@ void QOrientationReading::setOrientation(QOrientationReading::Orientation orient
\sa QSensorFilter::filter()
*/
+bool QOrientationFilter::filter(QSensorReading *reading)
+{
+ return filter(static_cast<QOrientationReading*>(reading));
+}
+
char const * const QOrientationSensor::type("QOrientationSensor");
/*!
@@ -190,6 +195,11 @@ QOrientationSensor::~QOrientationSensor()
\sa QSensor::reading()
*/
+QOrientationReading *QOrientationSensor::reading() const
+{
+ return static_cast<QOrientationReading*>(QSensor::reading());
+}
+
#include "moc_qorientationsensor.cpp"
QT_END_NAMESPACE
diff --git a/src/sensors/qorientationsensor.h b/src/sensors/qorientationsensor.h
index 082598f..a6fccb8 100644
--- a/src/sensors/qorientationsensor.h
+++ b/src/sensors/qorientationsensor.h
@@ -74,7 +74,7 @@ class Q_SENSORS_EXPORT QOrientationFilter : public QSensorFilter
public:
virtual bool filter(QOrientationReading *reading) = 0;
private:
- bool filter(QSensorReading *reading) { return filter(static_cast<QOrientationReading*>(reading)); }
+ bool filter(QSensorReading *reading);
};
class Q_SENSORS_EXPORT QOrientationSensor : public QSensor
@@ -83,7 +83,7 @@ class Q_SENSORS_EXPORT QOrientationSensor : public QSensor
public:
explicit QOrientationSensor(QObject *parent = 0);
virtual ~QOrientationSensor();
- QOrientationReading *reading() const { return static_cast<QOrientationReading*>(QSensor::reading()); }
+ QOrientationReading *reading() const;
static char const * const type;
private:
diff --git a/src/sensors/qpressuresensor.cpp b/src/sensors/qpressuresensor.cpp
index ea8a79b..ceb77df 100644
--- a/src/sensors/qpressuresensor.cpp
+++ b/src/sensors/qpressuresensor.cpp
@@ -101,6 +101,11 @@ void QPressureReading::setPressure(qreal pressure)
\sa QSensorFilter::filter()
*/
+bool QPressureFilter::filter(QSensorReading *reading)
+{
+ return filter(static_cast<QPressureReading*>(reading));
+}
+
char const * const QPressureSensor::type("QPressureSensor");
/*!
@@ -143,5 +148,10 @@ QPressureSensor::~QPressureSensor()
\sa QSensor::reading()
*/
+QPressureReading *QPressureSensor::reading() const
+{
+ return static_cast<QPressureReading*>(QSensor::reading());
+}
+
#include "moc_qpressuresensor.cpp"
QT_END_NAMESPACE
diff --git a/src/sensors/qpressuresensor.h b/src/sensors/qpressuresensor.h
index 50379b5..2a544cb 100644
--- a/src/sensors/qpressuresensor.h
+++ b/src/sensors/qpressuresensor.h
@@ -62,8 +62,7 @@ class Q_SENSORS_EXPORT QPressureFilter : public QSensorFilter
public:
virtual bool filter(QPressureReading *reading) = 0;
private:
- bool filter(QSensorReading *reading) Q_DECL_OVERRIDE
- { return filter(static_cast<QPressureReading*>(reading)); }
+ bool filter(QSensorReading *reading) Q_DECL_OVERRIDE;
};
class Q_SENSORS_EXPORT QPressureSensor : public QSensor
@@ -72,7 +71,7 @@ class Q_SENSORS_EXPORT QPressureSensor : public QSensor
public:
explicit QPressureSensor(QObject *parent = 0);
~QPressureSensor();
- QPressureReading *reading() const { return static_cast<QPressureReading*>(QSensor::reading()); }
+ QPressureReading *reading() const;
static char const * const type;
private:
diff --git a/src/sensors/qproximitysensor.cpp b/src/sensors/qproximitysensor.cpp
index 599d290..102976d 100644
--- a/src/sensors/qproximitysensor.cpp
+++ b/src/sensors/qproximitysensor.cpp
@@ -105,6 +105,11 @@ void QProximityReading::setClose(bool close)
\sa QSensorFilter::filter()
*/
+bool QProximityFilter::filter(QSensorReading *reading)
+{
+ return filter(static_cast<QProximityReading*>(reading));
+}
+
char const * const QProximitySensor::type("QProximitySensor");
/*!
@@ -146,6 +151,11 @@ QProximitySensor::~QProximitySensor()
\sa QSensor::reading()
*/
+QProximityReading *QProximitySensor::reading() const
+{
+ return static_cast<QProximityReading*>(QSensor::reading());
+}
+
#include "moc_qproximitysensor.cpp"
QT_END_NAMESPACE
diff --git a/src/sensors/qproximitysensor.h b/src/sensors/qproximitysensor.h
index cc8eb78..162334f 100644
--- a/src/sensors/qproximitysensor.h
+++ b/src/sensors/qproximitysensor.h
@@ -63,7 +63,7 @@ class Q_SENSORS_EXPORT QProximityFilter : public QSensorFilter
public:
virtual bool filter(QProximityReading *reading) = 0;
private:
- bool filter(QSensorReading *reading) { return filter(static_cast<QProximityReading*>(reading)); }
+ bool filter(QSensorReading *reading);
};
class Q_SENSORS_EXPORT QProximitySensor : public QSensor
@@ -72,7 +72,7 @@ class Q_SENSORS_EXPORT QProximitySensor : public QSensor
public:
explicit QProximitySensor(QObject *parent = 0);
virtual ~QProximitySensor();
- QProximityReading *reading() const { return static_cast<QProximityReading*>(QSensor::reading()); }
+ QProximityReading *reading() const;
static char const * const type;
private:
diff --git a/src/sensors/qrotationsensor.cpp b/src/sensors/qrotationsensor.cpp
index 06ee406..135b657 100644
--- a/src/sensors/qrotationsensor.cpp
+++ b/src/sensors/qrotationsensor.cpp
@@ -179,6 +179,11 @@ void QRotationReading::setFromEuler(qreal x, qreal y, qreal z)
\sa QSensorFilter::filter()
*/
+bool QRotationFilter::filter(QSensorReading *reading)
+{
+ return filter(static_cast<QRotationReading*>(reading));
+}
+
char const * const QRotationSensor::type("QRotationSensor");
/*!
@@ -220,6 +225,11 @@ QRotationSensor::~QRotationSensor()
\sa QSensor::reading()
*/
+QRotationReading *QRotationSensor::reading() const
+{
+ return static_cast<QRotationReading*>(QSensor::reading());
+}
+
/*!
\property QRotationSensor::hasZ
\brief a value indicating if the z angle is available.
diff --git a/src/sensors/qrotationsensor.h b/src/sensors/qrotationsensor.h
index 68a0d1d..e7d0e2e 100644
--- a/src/sensors/qrotationsensor.h
+++ b/src/sensors/qrotationsensor.h
@@ -68,7 +68,7 @@ class Q_SENSORS_EXPORT QRotationFilter : public QSensorFilter
public:
virtual bool filter(QRotationReading *reading) = 0;
private:
- bool filter(QSensorReading *reading) { return filter(static_cast<QRotationReading*>(reading)); }
+ bool filter(QSensorReading *reading);
};
class QRotationSensorPrivate;
@@ -80,7 +80,7 @@ class Q_SENSORS_EXPORT QRotationSensor : public QSensor
public:
explicit QRotationSensor(QObject *parent = 0);
virtual ~QRotationSensor();
- QRotationReading *reading() const { return static_cast<QRotationReading*>(QSensor::reading()); }
+ QRotationReading *reading() const;
static char const * const type;
bool hasZ() const;
diff --git a/src/sensors/qsensorbackend.cpp b/src/sensors/qsensorbackend.cpp
index 304674e..60ce8d7 100644
--- a/src/sensors/qsensorbackend.cpp
+++ b/src/sensors/qsensorbackend.cpp
@@ -136,10 +136,12 @@ QSensorReading *QSensorBackend::reading() const
}
/*!
- \fn QSensorBackend::sensor() const
-
Returns the sensor front end associated with this backend.
*/
+QSensor *QSensorBackend::sensor() const
+{
+ return m_sensor;
+}
/*!
\fn QSensorBackend::setReading(T *reading)
diff --git a/src/sensors/qsensorbackend.h b/src/sensors/qsensorbackend.h
index 4c6ce8b..c452a4d 100644
--- a/src/sensors/qsensorbackend.h
+++ b/src/sensors/qsensorbackend.h
@@ -75,7 +75,7 @@ public:
}
QSensorReading *reading() const;
- QSensor *sensor() const { return m_sensor; }
+ QSensor *sensor() const;
// used by the backend to inform us of events
void newReadingAvailable();
diff --git a/src/sensors/qsensormanager.cpp b/src/sensors/qsensormanager.cpp
index dbaf1eb..29bd4b5 100644
--- a/src/sensors/qsensormanager.cpp
+++ b/src/sensors/qsensormanager.cpp
@@ -496,9 +496,11 @@ void QSensor::registerInstance()
*/
/*!
- \fn QSensorBackendFactory::~QSensorBackendFactory()
\internal
*/
+QSensorBackendFactory::~QSensorBackendFactory()
+{
+}
/*!
\fn QSensorBackendFactory::createBackend(QSensor *sensor)
diff --git a/src/sensors/qsensormanager.h b/src/sensors/qsensormanager.h
index 8fa87d1..a1611cf 100644
--- a/src/sensors/qsensormanager.h
+++ b/src/sensors/qsensormanager.h
@@ -70,7 +70,7 @@ class Q_SENSORS_EXPORT QSensorBackendFactory
public:
virtual QSensorBackend *createBackend(QSensor *sensor) = 0;
protected:
- ~QSensorBackendFactory() {}
+ virtual ~QSensorBackendFactory();
};
QT_END_NAMESPACE
diff --git a/src/sensors/qsensorplugin.cpp b/src/sensors/qsensorplugin.cpp
index 29498b9..ae184eb 100644
--- a/src/sensors/qsensorplugin.cpp
+++ b/src/sensors/qsensorplugin.cpp
@@ -54,9 +54,11 @@
*/
/*!
- \fn QSensorPluginInterface::~QSensorPluginInterface()
\internal
*/
+QSensorPluginInterface::~QSensorPluginInterface()
+{
+}
/*!
\fn QSensorPluginInterface::registerSensors()
@@ -82,9 +84,12 @@
*/
/*!
- \fn QSensorChangesInterface::~QSensorChangesInterface()
\internal
*/
+QSensorChangesInterface::~QSensorChangesInterface()
+{
+}
+
/*!
\fn QSensorChangesInterface::sensorsChanged()
diff --git a/src/sensors/qsensorplugin.h b/src/sensors/qsensorplugin.h
index 336bce6..e81d4d5 100644
--- a/src/sensors/qsensorplugin.h
+++ b/src/sensors/qsensorplugin.h
@@ -53,7 +53,7 @@ class Q_SENSORS_EXPORT QSensorPluginInterface
public:
virtual void registerSensors() = 0;
protected:
- ~QSensorPluginInterface() {}
+ virtual ~QSensorPluginInterface();
};
class Q_SENSORS_EXPORT QSensorChangesInterface
@@ -61,7 +61,7 @@ class Q_SENSORS_EXPORT QSensorChangesInterface
public:
virtual void sensorsChanged() = 0;
protected:
- ~QSensorChangesInterface() {}
+ virtual ~QSensorChangesInterface();
};
Q_DECLARE_INTERFACE(QSensorPluginInterface, "com.qt-project.Qt.QSensorPluginInterface/1.0")
diff --git a/src/sensors/qtapsensor.cpp b/src/sensors/qtapsensor.cpp
index 23ec492..626268d 100644
--- a/src/sensors/qtapsensor.cpp
+++ b/src/sensors/qtapsensor.cpp
@@ -189,6 +189,11 @@ void QTapReading::setDoubleTap(bool doubleTap)
\sa QSensorFilter::filter()
*/
+bool QTapFilter::filter(QSensorReading *reading)
+{
+ return filter(static_cast<QTapReading*>(reading));
+}
+
char const * const QTapSensor::type("QTapSensor");
/*!
@@ -230,6 +235,11 @@ QTapSensor::~QTapSensor()
\sa QSensor::reading()
*/
+QTapReading *QTapSensor::reading() const
+{
+ return static_cast<QTapReading*>(QSensor::reading());
+}
+
/*!
\property QTapSensor::returnDoubleTapEvents
\brief a value indicating if double tap events should be reported.
diff --git a/src/sensors/qtapsensor.h b/src/sensors/qtapsensor.h
index b870411..688781e 100644
--- a/src/sensors/qtapsensor.h
+++ b/src/sensors/qtapsensor.h
@@ -84,7 +84,7 @@ class Q_SENSORS_EXPORT QTapFilter : public QSensorFilter
public:
virtual bool filter(QTapReading *reading) = 0;
private:
- bool filter(QSensorReading *reading) { return filter(static_cast<QTapReading*>(reading)); }
+ bool filter(QSensorReading *reading);
};
class QTapSensorPrivate;
@@ -97,7 +97,7 @@ class Q_SENSORS_EXPORT QTapSensor : public QSensor
public:
explicit QTapSensor(QObject *parent = 0);
virtual ~QTapSensor();
- QTapReading *reading() const { return static_cast<QTapReading*>(QSensor::reading()); }
+ QTapReading *reading() const;
static char const * const type;
bool returnDoubleTapEvents() const;
diff --git a/src/sensors/qtiltsensor.cpp b/src/sensors/qtiltsensor.cpp
index b78746b..220b8f9 100644
--- a/src/sensors/qtiltsensor.cpp
+++ b/src/sensors/qtiltsensor.cpp
@@ -118,6 +118,11 @@ void QTiltReading::setXRotation(qreal x)
\sa QSensorFilter::filter()
*/
+bool QTiltFilter::filter(QSensorReading *reading)
+{
+ return filter(static_cast<QTiltReading*>(reading));
+}
+
char const * const QTiltSensor::type("QTiltSensor");
/*!
@@ -162,6 +167,10 @@ QTiltSensor::~QTiltSensor()
\sa QSensor::reading()
*/
+QTiltReading *QTiltSensor::reading() const
+{
+ return static_cast<QTiltReading*>(QSensor::reading());
+}
/*!
Calibrates the tilt sensor. Uses the current tilt angles as 0.
diff --git a/src/sensors/qtiltsensor.h b/src/sensors/qtiltsensor.h
index 246a103..4d7e4c7 100644
--- a/src/sensors/qtiltsensor.h
+++ b/src/sensors/qtiltsensor.h
@@ -69,7 +69,7 @@ class Q_SENSORS_EXPORT QTiltFilter : public QSensorFilter
public:
virtual bool filter(QTiltReading *reading) = 0;
private:
- bool filter(QSensorReading *reading) { return filter(static_cast<QTiltReading*>(reading)); }
+ bool filter(QSensorReading *reading);
};
class Q_SENSORS_EXPORT QTiltSensor : public QSensor
@@ -78,7 +78,7 @@ class Q_SENSORS_EXPORT QTiltSensor : public QSensor
public:
explicit QTiltSensor(QObject *parent = 0);
~QTiltSensor();
- QTiltReading *reading() const { return static_cast<QTiltReading*>(QSensor::reading()); }
+ QTiltReading *reading() const;
static char const * const type;
Q_INVOKABLE void calibrate();