Home · All Classes · All Functions ·

QSensorFactory Class Reference

The QSensorFactory class returns the sensors on a device. More...

    #include <QSensorFactory>

This class is under development and is subject to change.


Public Functions

QSensor * createSensor ( const QByteArray & identifier ) const
QByteArray defaultSensorForType ( const QByteArray & type ) const
QList<QByteArray> sensorList () const
QList<QByteArray> sensorTypes () const
QList<QByteArray> sensorsForType ( const QByteArray & type ) const

Static Public Members

QSensorFactory * instance ()

Detailed Description

The QSensorFactory class returns the sensors on a device.

A given device will have a variety of sensors. The sensors are categorized by type. Each sensor has a ::typeId value that holds the unique type for that sensor. eg. QAccelerationSensor::typeId, QProximitySensor::typeId.


Member Function Documentation

QSensor * QSensorFactory::createSensor ( const QByteArray & identifier ) const

Create an instance of a sensor for identifier. If there is no sensor with the selected identifier, returns null.

Note that this method requires down-casting the returned pointer to do anything useful. Instead, consider instantiating a QSensor sub-class directly, passing the identifier as the second argument.

QByteArray QSensorFactory::defaultSensorForType ( const QByteArray & type ) const

Returns the identifier of the default sensor for type. If there is no sensor of that type available, returns a null string.

QSensorFactory * QSensorFactory::instance ()   [static]

Returns the sensor factory.

QList<QByteArray> QSensorFactory::sensorList () const

Returns a list of ids for each of the sensors.

QList<QByteArray> QSensorFactory::sensorTypes () const

Returns a list of all sensor types.

QList<QByteArray> QSensorFactory::sensorsForType ( const QByteArray & type ) const

Returns a list of ids for each of the sensors for type. If there are no sensors of that type available the list will be empty.


Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) Trademarks
Qt Mobility Project 1.0.0