<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qmlsensor.cpp --> <title>Sensor QML Type | Qt Sensors 5.9</title> <link rel="stylesheet" type="text/css" href="style/offline-simple.css" /> <script type="text/javascript"> document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css"); // loading style sheet breaks anchors that were jumped to before // so force jumping to anchor again setTimeout(function() { var anchor = location.hash; // need to jump to different anchor first (e.g. none) location.hash = "#"; setTimeout(function() { location.hash = anchor; }, 0); }, 0); </script> </head> <body> <div class="header" id="qtdocheader"> <div class="main"> <div class="main-rounded"> <div class="navigationbar"> <table><tr> <td >Qt 5.9</td><td ><a href="qtsensors-index.html">Qt Sensors</a></td><td ><a href="qtsensors-qmlmodule.html">QML Types</a></td><td >Sensor QML Type</td></tr></table><table class="buildversion"><tr> <td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td> </tr></table> </div> </div> <div class="content"> <div class="line"> <div class="content mainContent"> <div class="sidebar"> <div class="toc"> <h3><a name="toc">Contents</a></h3> <ul> <li class="level1"><a href="#properties">Properties</a></li> <li class="level1"><a href="#methods">Methods</a></li> <li class="level1"><a href="#details">Detailed Description</a></li> </ul> </div> <div class="sidebar-content" id="sidebar-content"></div></div> <h1 class="title">Sensor QML Type</h1> <span class="subtitle"></span> <!-- $$$Sensor-brief --> <p>The Sensor element serves as a base type for sensors. <a href="#details">More...</a></p> <!-- @@@Sensor --> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import QtSensors 5.0</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign"> QtSensors 5.0</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherited By:</td><td class="memItemRight bottomAlign"> <p><a href="qml-qtsensors-accelerometer.html">Accelerometer</a>, <a href="qml-qtsensors-altimeter.html">Altimeter</a>, <a href="qml-qtsensors-ambientlightsensor.html">AmbientLightSensor</a>, <a href="qml-qtsensors-ambienttemperaturesensor.html">AmbientTemperatureSensor</a>, <a href="qml-qtsensors-compass.html">Compass</a>, <a href="qml-qtsensors-distancesensor.html">DistanceSensor</a>, <a href="qml-qtsensors-gyroscope.html">Gyroscope</a>, <a href="qml-qtsensors-holstersensor.html">HolsterSensor</a>, <a href="qml-qtsensors-humiditysensor.html">HumiditySensor</a>, <a href="qml-qtsensors-irproximitysensor.html">IRProximitySensor</a>, <a href="qml-qtsensors-lidsensor.html">LidSensor</a>, <a href="qml-qtsensors-lightsensor.html">LightSensor</a>, <a href="qml-qtsensors-magnetometer.html">Magnetometer</a>, <a href="qml-qtsensors-orientationsensor.html">OrientationSensor</a>, <a href="qml-qtsensors-pressuresensor.html">PressureSensor</a>, <a href="qml-qtsensors-proximitysensor.html">ProximitySensor</a>, <a href="qml-qtsensors-rotationsensor.html">RotationSensor</a>, <a href="qml-qtsensors-tapsensor.html">TapSensor</a>, and <a href="qml-qtsensors-tiltsensor.html">TiltSensor</a></p> </td></tr></table></div><ul> <li><a href="qml-qtsensors-sensor-members.html">List of all members, including inherited members</a></li> </ul> <a name="properties"></a> <h2 id="properties">Properties</h2> <ul> <li class="fn"><b><b><a href="qml-qtsensors-sensor.html#active-prop">active</a></b></b> : bool</li> <li class="fn"><b><b><a href="qml-qtsensors-sensor.html#alwaysOn-prop">alwaysOn</a></b></b> : bool</li> <li class="fn"><b><b><a href="qml-qtsensors-sensor.html#availableDataRates-prop">availableDataRates</a></b></b> : list<Range></li> <li class="fn"><b><b><a href="qml-qtsensors-sensor.html#axesOrientationMode-prop">axesOrientationMode</a></b></b> : Sensor::AxesOrientationMode</li> <li class="fn"><b><b><a href="qml-qtsensors-sensor.html#bufferSize-prop">bufferSize</a></b></b> : int</li> <li class="fn"><b><b><a href="qml-qtsensors-sensor.html#busy-prop">busy</a></b></b> : bool</li> <li class="fn"><b><b><a href="qml-qtsensors-sensor.html#connectedToBackend-prop">connectedToBackend</a></b></b> : bool</li> <li class="fn"><b><b><a href="qml-qtsensors-sensor.html#currentOrientation-prop">currentOrientation</a></b></b> : int</li> <li class="fn"><b><b><a href="qml-qtsensors-sensor.html#dataRate-prop">dataRate</a></b></b> : int</li> <li class="fn"><b><b><a href="qml-qtsensors-sensor.html#description-prop">description</a></b></b> : string</li> <li class="fn"><b><b><a href="qml-qtsensors-sensor.html#efficientBufferSize-prop">efficientBufferSize</a></b></b> : int</li> <li class="fn"><b><b><a href="qml-qtsensors-sensor.html#error-prop">error</a></b></b> : int</li> <li class="fn"><b><b><a href="qml-qtsensors-sensor.html#identifier-prop">identifier</a></b></b> : string</li> <li class="fn"><b><b><a href="qml-qtsensors-sensor.html#maxBufferSize-prop">maxBufferSize</a></b></b> : int</li> <li class="fn"><b><b><a href="qml-qtsensors-sensor.html#outputRange-prop">outputRange</a></b></b> : int</li> <li class="fn"><b><b><a href="qml-qtsensors-sensor.html#outputRanges-prop">outputRanges</a></b></b> : list<OutputRange></li> <li class="fn"><b><b><a href="qml-qtsensors-sensor.html#reading-prop">reading</a></b></b> : SensorReading</li> <li class="fn"><b><b><a href="qml-qtsensors-sensor.html#skipDuplicates-prop">skipDuplicates</a></b></b> : bool</li> <li class="fn"><b><b><a href="qml-qtsensors-sensor.html#type-prop">type</a></b></b> : string</li> <li class="fn"><b><b><a href="qml-qtsensors-sensor.html#userOrientation-prop">userOrientation</a></b></b> : int</li> </ul> <a name="methods"></a> <h2 id="methods">Methods</h2> <ul> <li class="fn">bool <b><b><a href="qml-qtsensors-sensor.html#start-method">start</a></b></b>()</li> <li class="fn">bool <b><b><a href="qml-qtsensors-sensor.html#stop-method">stop</a></b></b>()</li> </ul> <!-- $$$Sensor-description --> <a name="details"></a> <h2 id="details">Detailed Description</h2> <p>The Sensor element serves as a base type for sensors.</p> <p>This element wraps the <a href="qsensor.html">QSensor</a> class. Please see the documentation for <a href="qsensor.html">QSensor</a> for details.</p> <p>This element cannot be directly created. Please use one of the sub-classes instead.</p> <!-- @@@Sensor --> <h2>Property Documentation</h2> <!-- $$$active --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="active-prop"> <td class="tblQmlPropNode"><p> <a name="active-prop"></a><span class="name">active</span> : <span class="type">bool</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property holds a value to indicate if the sensor is active.</p> <p>Please see <a href="qsensor.html#active-prop">QSensor::active</a> for information about this property.</p> </div></div><!-- @@@active --> <br/> <!-- $$$alwaysOn --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="alwaysOn-prop"> <td class="tblQmlPropNode"><p> <a name="alwaysOn-prop"></a><span class="name">alwaysOn</span> : <span class="type">bool</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property holds a value to indicate if the sensor should remain running when the screen is off.</p> <p>Please see <a href="qsensor.html#alwaysOn-prop">QSensor::alwaysOn</a> for information about this property.</p> </div></div><!-- @@@alwaysOn --> <br/> <!-- $$$availableDataRates --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="availableDataRates-prop"> <td class="tblQmlPropNode"><p> <a name="availableDataRates-prop"></a><span class="name">availableDataRates</span> : <span class="type">list</span><<span class="type">Range</span>></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property holds the data rates that the sensor supports.</p> <p>Please see <a href="qsensor.html#availableDataRates-prop">QSensor::availableDataRates</a> for information about this property.</p> </div></div><!-- @@@availableDataRates --> <br/> <!-- $$$axesOrientationMode --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="axesOrientationMode-prop"> <td class="tblQmlPropNode"><p> <a name="axesOrientationMode-prop"></a><span class="name">axesOrientationMode</span> : <span class="type">Sensor::AxesOrientationMode</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property holds the mode that affects how the screen orientation changes reading values.</p> <p>Please see <a href="qsensor.html#axesOrientationMode-prop">QSensor::axesOrientationMode</a> for information about this property.</p> <p>This QML property was introduced in QtSensors 5.1.</p> </div></div><!-- @@@axesOrientationMode --> <br/> <!-- $$$bufferSize --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="bufferSize-prop"> <td class="tblQmlPropNode"><p> <a name="bufferSize-prop"></a><span class="name">bufferSize</span> : <span class="type">int</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property holds the size of the buffer.</p> <p>Please see <a href="qsensor.html#bufferSize-prop">QSensor::bufferSize</a> for information about this property.</p> <p>This QML property was introduced in QtSensors 5.1.</p> </div></div><!-- @@@bufferSize --> <br/> <!-- $$$busy --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="busy-prop"> <td class="tblQmlPropNode"><p> <a name="busy-prop"></a><span class="name">busy</span> : <span class="type">bool</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property holds a value to indicate if the sensor is busy.</p> <p>Please see <a href="qsensor.html#busy-prop">QSensor::busy</a> for information about this property.</p> </div></div><!-- @@@busy --> <br/> <!-- $$$connectedToBackend --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="connectedToBackend-prop"> <td class="tblQmlPropNode"><p> <a name="connectedToBackend-prop"></a><span class="name">connectedToBackend</span> : <span class="type">bool</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property holds a value indicating if the sensor has connected to a backend.</p> <p>Please see <a href="qsensor.html#connectedToBackend-prop">QSensor::connectedToBackend</a> for information about this property.</p> </div></div><!-- @@@connectedToBackend --> <br/> <!-- $$$currentOrientation --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="currentOrientation-prop"> <td class="tblQmlPropNode"><p> <a name="currentOrientation-prop"></a><span class="name">currentOrientation</span> : <span class="type">int</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property holds the current orientation that is used for rotating the reading values.</p> <p>Please see <a href="qsensor.html#currentOrientation-prop">QSensor::currentOrientation</a> for information about this property.</p> <p>This QML property was introduced in QtSensors 5.1.</p> </div></div><!-- @@@currentOrientation --> <br/> <!-- $$$dataRate --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="dataRate-prop"> <td class="tblQmlPropNode"><p> <a name="dataRate-prop"></a><span class="name">dataRate</span> : <span class="type">int</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property holds the data rate that the sensor should be run at.</p> <p>Please see <a href="qsensor.html#dataRate-prop">QSensor::dataRate</a> for information about this property.</p> </div></div><!-- @@@dataRate --> <br/> <!-- $$$description --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="description-prop"> <td class="tblQmlPropNode"><p> <a name="description-prop"></a><span class="name">description</span> : <span class="type">string</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property holds a descriptive string for the sensor.</p> </div></div><!-- @@@description --> <br/> <!-- $$$efficientBufferSize --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="efficientBufferSize-prop"> <td class="tblQmlPropNode"><p> <a name="efficientBufferSize-prop"></a><span class="name">efficientBufferSize</span> : <span class="type">int</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>The property holds the most efficient buffer size.</p> <p>Please see <a href="qsensor.html#efficientBufferSize-prop">QSensor::efficientBufferSize</a> for information about this property.</p> <p>This QML property was introduced in QtSensors 5.1.</p> </div></div><!-- @@@efficientBufferSize --> <br/> <!-- $$$error --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="error-prop"> <td class="tblQmlPropNode"><p> <a name="error-prop"></a><span class="name">error</span> : <span class="type">int</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property holds the last error code set on the sensor.</p> </div></div><!-- @@@error --> <br/> <!-- $$$identifier --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="identifier-prop"> <td class="tblQmlPropNode"><p> <a name="identifier-prop"></a><span class="name">identifier</span> : <span class="type">string</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property holds the backend identifier for the sensor.</p> <p>Please see <a href="qsensor.html#identifier-prop">QSensor::identifier</a> for information about this property.</p> </div></div><!-- @@@identifier --> <br/> <!-- $$$maxBufferSize --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="maxBufferSize-prop"> <td class="tblQmlPropNode"><p> <a name="maxBufferSize-prop"></a><span class="name">maxBufferSize</span> : <span class="type">int</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property holds the maximum buffer size.</p> <p>Please see <a href="qsensor.html#maxBufferSize-prop">QSensor::maxBufferSize</a> for information about this property.</p> <p>This QML property was introduced in QtSensors 5.1.</p> </div></div><!-- @@@maxBufferSize --> <br/> <!-- $$$outputRange --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="outputRange-prop"> <td class="tblQmlPropNode"><p> <a name="outputRange-prop"></a><span class="name">outputRange</span> : <span class="type">int</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property holds the output range in use by the sensor.</p> <p>Please see <a href="qsensor.html#outputRange-prop">QSensor::outputRange</a> for information about this property.</p> </div></div><!-- @@@outputRange --> <br/> <!-- $$$outputRanges --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="outputRanges-prop"> <td class="tblQmlPropNode"><p> <a name="outputRanges-prop"></a><span class="name">outputRanges</span> : <span class="type">list</span><<span class="type">OutputRange</span>></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property holds a list of output ranges the sensor supports.</p> <p>Please see <a href="qsensor.html#outputRanges-prop">QSensor::outputRanges</a> for information about this property.</p> </div></div><!-- @@@outputRanges --> <br/> <!-- $$$reading --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="reading-prop"> <td class="tblQmlPropNode"><p> <a name="reading-prop"></a><span class="name">reading</span> : <span class="type"><a href="qml-qtsensors-sensorreading.html">SensorReading</a></span></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property holds the reading class.</p> <p>Please see <a href="qsensor.html#reading-prop">QSensor::reading</a> for information about this property.</p> <p><b>See also </b><a href="qtsensors-qmlmodule.html#qml-reading-types">QML Reading types</a>.</p> </div></div><!-- @@@reading --> <br/> <!-- $$$skipDuplicates --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="skipDuplicates-prop"> <td class="tblQmlPropNode"><p> <a name="skipDuplicates-prop"></a><span class="name">skipDuplicates</span> : <span class="type">bool</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property indicates whether duplicate reading values should be omitted.</p> <p>Please see <a href="qsensor.html#skipDuplicates-prop">QSensor::skipDuplicates</a> for information about this property.</p> <p>This QML property was introduced in QtSensors 5.1.</p> </div></div><!-- @@@skipDuplicates --> <br/> <!-- $$$type --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="type-prop"> <td class="tblQmlPropNode"><p> <a name="type-prop"></a><span class="name">type</span> : <span class="type">string</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property holds the type of the sensor.</p> </div></div><!-- @@@type --> <br/> <!-- $$$userOrientation --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="userOrientation-prop"> <td class="tblQmlPropNode"><p> <a name="userOrientation-prop"></a><span class="name">userOrientation</span> : <span class="type">int</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property holds the angle used for rotating the reading values in the UserOrientation mode.</p> <p>Please see <a href="qsensor.html#userOrientation-prop">QSensor::userOrientation</a> for information about this property.</p> <p>This QML property was introduced in QtSensors 5.1.</p> </div></div><!-- @@@userOrientation --> <br/> <h2>Method Documentation</h2> <!-- $$$start --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="start-method"> <td class="tblQmlFuncNode"><p> <a name="start-method"></a><span class="type">bool</span> <span class="name">start</span>()</p></td></tr> </table></div> </div><div class="qmldoc"><p>Start retrieving values from the sensor. Returns true if the sensor was started, false otherwise.</p> <p>Please see <a href="qsensor.html#start">QSensor::start()</a> for information.</p> </div></div><!-- @@@start --> <br/> <!-- $$$stop --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="stop-method"> <td class="tblQmlFuncNode"><p> <a name="stop-method"></a><span class="type">bool</span> <span class="name">stop</span>()</p></td></tr> </table></div> </div><div class="qmldoc"><p>Stop retrieving values from the sensor.</p> <p>Please see <a href="qsensor.html#stop">QSensor::stop()</a> for information.</p> </div></div><!-- @@@stop --> <br/> </div> </div> </div> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2017 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.<br> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br> Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. </p> </div> </body> </html>