Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > 50facae208d4a6f280e44a513b104320 > files > 1690

qt-mobility-doc-1.2.0-13.mga5.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qsensor.cpp -->
  <title>Qt Mobility 1.2: QSensorReading Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="content"> 
    <a href="index.html" class="qtref"><span>QtMobility Reference Documentation</span></a>
  </div>
  <div class="breadcrumb toolblock">
    <ul>
      <li class="first"><a href="index.html">Home</a></li>
      <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtsensors.html">QtSensors</a></li>
<li>QSensorReading</li>
    </ul>
  </div>
</div>
<div class="content mainContent">
<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="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#macros">Macros</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QSensorReading Class Reference</h1>
<!-- $$$QSensorReading-brief -->
<p>The QSensorReading class holds the readings from the sensor. <a href="#details">More...</a></p>
<!-- @@@QSensorReading -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QSensorReading&gt;</span></pre><p><b>Inherits: </b><a href="http://qt.nokia.com/doc/4.7/qobject.html">QObject</a>.</p>
<p><b>Inherited by: </b><a href="qaccelerometerreading.html">QAccelerometerReading</a>, <a href="qambientlightreading.html">QAmbientLightReading</a>, <a href="qcompassreading.html">QCompassReading</a>, <a href="qgyroscopereading.html">QGyroscopeReading</a>, <a href="qlightreading.html">QLightReading</a>, <a href="qmagnetometerreading.html">QMagnetometerReading</a>, <a href="qorientationreading.html">QOrientationReading</a>, <a href="qproximityreading.html">QProximityReading</a>, <a href="qrotationreading.html">QRotationReading</a>, and <a href="qtapreading.html">QTapReading</a>.</p>
<p>This class was introduced in Qt Mobility 1.0.</p>
<ul>
<li><a href="qsensorreading-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2>Properties</h2>
<ul>
<li class="fn"><b><a href="qsensorreading.html#timestamp-prop">timestamp</a></b> : const QtMobility::qtimestamp</li>
</ul>
<ul>
<li class="fn">1 property inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsensorreading.html#setTimestamp">setTimestamp</a></b> ( qtimestamp <i>timestamp</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qtimestamp </td><td class="memItemRight bottomAlign"><b><a href="qsensorreading.html#timestamp-prop">timestamp</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="qsensorreading.html#value">value</a></b> ( int <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qsensorreading.html#valueCount">valueCount</a></b> () const</td></tr>
</table>
<ul>
<li class="fn">29 public functions inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#public-functions">QObject</a></li>
</ul>
<a name="macros"></a>
<h2>Macros</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qsensorreading.html#DECLARE_READING">DECLARE_READING</a></b> (  <i>classname</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qsensorreading.html#IMPLEMENT_READING">IMPLEMENT_READING</a></b> (  <i>classname</i> )</td></tr>
</table>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 public slot inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#public-slots">QObject</a></li>
<li class="fn">1 signal inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#signals">QObject</a></li>
<li class="fn">1 public variable inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#public-variables">QObject</a></li>
<li class="fn">4 static public members inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#static-public-members">QObject</a></li>
<li class="fn">7 protected functions inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#protected-functions">QObject</a></li>
<li class="fn">2 protected variables inherited from <a href="http://qt.nokia.com/doc/4.7/qobject.html#protected-variables">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QSensorReading-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QSensorReading class holds the readings from the sensor.</p>
<p>Note that QSensorReading is not particularly useful by itself. The interesting data for each sensor is defined in a sub-class of QSensorReading.</p>
</div>
<!-- @@@QSensorReading -->
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$timestamp-prop$$$timestamp -->
<h3 class="fn"><a name="timestamp-prop"></a><span class="name">timestamp</span> : const <span class="type">QtMobility::qtimestamp</span></h3>
<p>This property holds the timestamp of the reading.</p>
<p>This property was introduced in Qt Mobility 1.0.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> qtimestamp </td><td class="memItemRight bottomAlign"><span class="name"><b>timestamp</b></span> () const</td></tr>
</table>
<p><b>See also </b><a href="qsensor.html#qtimestamp-typedef">qtimestamp</a>.</p>
<!-- @@@timestamp -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$setTimestamp[overload1]$$$setTimestampqtimestamp -->
<h3 class="fn"><a name="setTimestamp"></a><span class="type">void</span> QSensorReading::<span class="name">setTimestamp</span> ( <span class="type"><a href="qsensor.html#qtimestamp-typedef">qtimestamp</a></span> <i>timestamp</i> )</h3>
<p>Sets the <i>timestamp</i> of the reading.</p>
<p>This function was introduced in Qt Mobility 1.0.</p>
<p><b>See also </b><a href="qsensorreading.html#timestamp-prop">timestamp</a>().</p>
<!-- @@@setTimestamp -->
<!-- $$$value[overload1]$$$valueint -->
<h3 class="fn"><a name="value"></a><span class="type"><a href="http://qt.nokia.com/doc/4.7/qvariant.html">QVariant</a></span> QSensorReading::<span class="name">value</span> ( <span class="type">int</span> <i>index</i> ) const</h3>
<p>Returns the value of the property at <i>index</i>.</p>
<p>Note that this function is slower than calling the data function directly.</p>
<p>Here is an example of getting a property via the different mechanisms available.</p>
<p>Accessing directly provides the best performance but requires compile-time knowledge of the data you are accessing.</p>
<pre class="cpp"> <span class="type"><a href="qaccelerometerreading.html">QAccelerometerReading</a></span> <span class="operator">*</span>reading <span class="operator">=</span> <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>;
 <span class="type"><a href="http://qt.nokia.com/doc/4.7/qtglobal.html#qreal-typedef">qreal</a></span> x <span class="operator">=</span> reading<span class="operator">-</span><span class="operator">&gt;</span>x();</pre>
<p>You can also access a property by name. To do this you must call <a href="http://qt.nokia.com/doc/4.7/qobject.html#property">QObject::property</a>().</p>
<pre class="cpp"> <span class="type"><a href="http://qt.nokia.com/doc/4.7/qtglobal.html#qreal-typedef">qreal</a></span> x <span class="operator">=</span> reading<span class="operator">-</span><span class="operator">&gt;</span><a href="http://qt.nokia.com/doc/4.7/qobject.html#property">property</a>(<span class="string">&quot;x&quot;</span>)<span class="operator">.</span>value<span class="operator">&lt;</span><span class="type"><a href="http://qt.nokia.com/doc/4.7/qtglobal.html#qreal-typedef">qreal</a></span><span class="operator">&gt;</span>();</pre>
<p>Finally, you can access values via numeric index.</p>
<pre class="cpp"> <span class="type"><a href="http://qt.nokia.com/doc/4.7/qtglobal.html#qreal-typedef">qreal</a></span> x <span class="operator">=</span> reading<span class="operator">-</span><span class="operator">&gt;</span>value(<span class="number">0</span>)<span class="operator">.</span>value<span class="operator">&lt;</span><span class="type"><a href="http://qt.nokia.com/doc/4.7/qtglobal.html#qreal-typedef">qreal</a></span><span class="operator">&gt;</span>();</pre>
<p>Note that value() can only access properties declared with <a href="http://qt.nokia.com/doc/4.7/qobject.html#Q_PROPERTY">Q_PROPERTY</a>() in sub-classes of <a href="qsensorreading.html">QSensorReading</a>.</p>
<p>This function was introduced in Qt Mobility 1.0.</p>
<p><b>See also </b><a href="qsensorreading.html#valueCount">valueCount</a>() and <a href="http://qt.nokia.com/doc/4.7/qobject.html#property">QObject::property</a>().</p>
<!-- @@@value -->
<!-- $$$valueCount[overload1]$$$valueCount -->
<h3 class="fn"><a name="valueCount"></a><span class="type">int</span> QSensorReading::<span class="name">valueCount</span> () const</h3>
<p>Returns the number of extra properties that the reading has.</p>
<p>Note that this does not count properties declared in <a href="qsensorreading.html">QSensorReading</a>.</p>
<p>As an example, this returns 3 for <a href="qaccelerometerreading.html">QAccelerometerReading</a> because there are 3 properties defined in that class.</p>
<p>This function was introduced in Qt Mobility 1.0.</p>
<!-- @@@valueCount -->
</div>
<div class="macros">
<h2>Macro Documentation</h2>
<!-- $$$DECLARE_READING[overload1]$$$DECLARE_READING -->
<h3 class="fn"><a name="DECLARE_READING"></a><span class="name">DECLARE_READING</span> (  <i>classname</i> )</h3>
<p>The DECLARE_READING macro adds some required methods to a reading class.</p>
<p>This macro should be used for all reading classes. Pass the <i>classname</i> of your reading class.</p>
<pre class="cpp"> <span class="keyword">class</span> MyReading : <span class="keyword">public</span> <span class="type"><a href="qsensorreading.html">QSensorReading</a></span>
 {
     Q_OBJECT
     Q_PROPERTY(<span class="type"><a href="http://qt.nokia.com/doc/4.7/qtglobal.html#qreal-typedef">qreal</a></span> myprop READ myprop)
     DECLARE_READING(MyReading)
 <span class="keyword">public</span>:
     <span class="type"><a href="http://qt.nokia.com/doc/4.7/qtglobal.html#qreal-typedef">qreal</a></span> myprop() <span class="keyword">const</span>;
     vod setMyprop(<span class="type"><a href="http://qt.nokia.com/doc/4.7/qtglobal.html#qreal-typedef">qreal</a></span> myprop);
 };</pre>
<p><b>See also </b><a href="qsensorreading.html#IMPLEMENT_READING">IMPLEMENT_READING</a>().</p>
<!-- @@@DECLARE_READING -->
<!-- $$$IMPLEMENT_READING[overload1]$$$IMPLEMENT_READING -->
<h3 class="fn"><a name="IMPLEMENT_READING"></a><span class="name">IMPLEMENT_READING</span> (  <i>classname</i> )</h3>
<p>The IMPLEMENT_READING macro implements the required methods for a reading class.</p>
<p>This macro should be used for all reading classes. It should be placed into a single compilation unit (source file), not into a header file. Pass the <i>classname</i> of your reading class.</p>
<pre class="cpp"> IMPLEMENT_READING(MyReading)</pre>
<p><b>See also </b><a href="qsensorreading.html#DECLARE_READING">DECLARE_READING</a>().</p>
<!-- @@@IMPLEMENT_READING -->
</div>
  <div class="ft">
    <span></span>
  </div>
</div> 
<div class="footer">
  <p>
     <acronym title="Copyright">&copy;</acronym> 2008-2011 Nokia Corporation and/or its
     subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation 
     in Finland and/or other countries worldwide.</p>
  <p>
     All other trademarks are property of their respective owners. <a title="Privacy Policy"
     href="http://qt.nokia.com/about/privacy-policy">Privacy Policy</a></p>
  <br />
  <p>
    Licensees holding valid Qt Commercial licenses may use this document in accordance with the    Qt Commercial License Agreement provided with the Software or, alternatively, in accordance    with the terms contained in a written agreement between you and Nokia.</p>
  <p>
    Alternatively, this document may be used 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.</p>
</div>
</body>
</html>