diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-05-23 13:18:07 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-05-23 13:18:07 +0200 |
commit | e8237a3d19e90c31af6d5a6c5e3a2f7815740226 (patch) | |
tree | 24696c0400318684bc00cf36d41a445051b67b96 /src/sensors/qsensor.cpp | |
parent | f57241666fd4b7074cbe33567827293e2a0a9ad5 (diff) | |
parent | 3d75c54b8d0d055eff2a41cef7733b6204f8241c (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I497c153fe555fbfbbd5fbb40f65f614ee33b065d
Diffstat (limited to 'src/sensors/qsensor.cpp')
-rw-r--r-- | src/sensors/qsensor.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/sensors/qsensor.cpp b/src/sensors/qsensor.cpp index fad1de2d..7f05189f 100644 --- a/src/sensors/qsensor.cpp +++ b/src/sensors/qsensor.cpp @@ -262,6 +262,23 @@ void QSensorPrivate::init(const QByteArray &sensorType) /*! Construct the \a type sensor as a child of \a parent. + + Do not use this constructor if a derived class exists for the specific sensor type. + + The wrong way is to use the base class constructor: + \snippet sensors/creating.cpp 3 + The right way is to create an instance of the derived class: + \snippet sensors/creating.cpp 2 + + The derived classes have + additional properties and data members which are needed for certain features such as + geo value support in QMagnetometer or acceleration mode support in QAccelerometer. + These features will only work properly when creating a sensor instance from a QSensor + subclass. + + Only use this constructor if there is no derived sensor class available. Note that all + built-in sensors have a derived class, so using this constructor should only be necessary + when implementing custom sensors, like in the \l {Qt Sensors - Grue Sensor Example}{Grue sensor example}. */ QSensor::QSensor(const QByteArray &type, QObject *parent) : QObject(*new QSensorPrivate, parent) |