Source

Target

Commits (5)
Showing with 91 additions and 4 deletions
Qt 5.1 introduces many new features and improvements as well as bugfixes
over the 5.0.x series. For more details, refer to the online documentation
included in this distribution. The documentation is also available online:
http://qt-project.org/doc/qt-5.1
The Qt version 5.1 series is binary compatible with the 5.0.x series.
Applications compiled for 5.0 will continue to run with 5.1.
Some of the changes listed in this file include issue tracking numbers
corresponding to tasks in the Qt Bug Tracker:
http://bugreports.qt-project.org/
Each of these identifiers can be entered in the bug tracker to obtain more
information about a particular change.
****************************************************************************
* General *
****************************************************************************
- Add a QAmbientTemperatureSensor class.
- Add a QAltimeter class.
- Add QHolsterSensor
- Add API for duplicate skipping
- Add QPressureSensor
- Add QSensor::isFeatureSupported()
- Add linux sys accelerometer reader backend
- Introduce QRotationReading::setFromEuler() in favor of set{X/Y/Z}()
- Add support for the compass sensor
- Add support for the pressure sensor
- Add support for the IR proximity sensor
- Add support for tilt sensor
- Add sensor backend for sensorfw
- Add freefall sensor gesture
Qt for Android
--------------
- Sensor implementation for Android
Qt for BlackBerry
-----------------
- Support QMagnetometer::returnGeoValues
- Prevent spurious calls to dataAvailable() when stopped
Qt for iOS
----------
- Implement accelerometer for iOS
......@@ -5,9 +5,7 @@ SUBDIRS += grue
qtHaveModule(quick) {
SUBDIRS += \
accelbubble \
cubehouse \
qmlsensorgestures \
maze \
qmlqtsensors \
sensor_explorer \
shakeit
......@@ -16,4 +14,10 @@ qtHaveModule(quick) {
qtHaveModule(widgets): SUBDIRS += \
sensorgestures
qtHaveModule(3d): SUBDIRS += \
cubehouse
qtHaveModule(systeminfo): SUBDIRS += \
maze
OTHER_FILES = stub.h
......@@ -55,7 +55,6 @@ class dummySensorPlugin : public QObject, public QSensorPluginInterface, public
public:
void registerSensors()
{
qDebug() << "loaded the dummy plugin";
QSensorManager::registerBackend(QAccelerometer::type, dummyaccelerometer::id, this);
QSensorManager::registerBackend(QAmbientLightSensor::type, dummylightsensor::id, this);
}
......
......@@ -56,7 +56,6 @@ class LinuxSensorPlugin : public QObject, public QSensorPluginInterface, public
public:
void registerSensors()
{
qDebug() << "loaded the Linux plugin";
QString path = QString::fromLatin1(qgetenv("QT_ACCEL_FILEPATH"));
if (!path.isEmpty() && !QSensorManager::isBackendRegistered(QAccelerometer::type, LinuxSysAccelerometer::id))
QSensorManager::registerBackend(QAccelerometer::type, LinuxSysAccelerometer::id, this);
......
......@@ -40,6 +40,7 @@
#include <QObject>
#include <qaccelerometer.h>
#include <qmagnetometer.h>
#include <qorientationsensor.h>
class MyObject : public QObject
......@@ -59,5 +60,20 @@ QOrientationSensor orient_sensor;
Q_UNUSED(sensor)
Q_UNUSED(orient_sensor);
{
//! [2]
QMagnetometer *magnetometer = new QMagnetometer(this);
//! [2]
Q_UNUSED(magnetometer);
}
{
//! [3]
QSensor *magnetometer = new QSensor(QMagnetometer::type, this);
//! [3]
Q_UNUSED(magnetometer);
}
}
......@@ -258,6 +258,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)
......