Sophie

Sophie

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

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" />
<!-- qdeclarativepositionsource.cpp -->
  <title>Qt Mobility 1.2: QML PositionSource Element</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="http://qt.nokia.com/doc/4.7/qdeclarativeelements.html">QML Elements</a></li>
<li>QML PositionSource Element</li>
    </ul>
  </div>
</div>
<div class="content mainContent">
<p class="naviNextPrevious headerNavi">
</p><p/>
<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="#signal-handlers">Signal Handlers</a></li>
<li class="level1"><a href="#methods">Methods</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QML PositionSource Element</h1>
<span class="subtitle"></span>
<!-- $$$PositionSource-brief -->
<p>The PositionSource element allows you to get information about your current position. <a href="#details">More...</a></p>
<!-- @@@PositionSource -->
<p>This element was introduced in  Mobility 1.2.</p>
<ul>
<li><a href="qml-positionsource-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2>Properties</h2>
<ul>
<li class="fn"><b><b><a href="qml-positionsource.html#active-prop">active</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-positionsource.html#nmeaSource-prop">nmeaSource</a></b></b> : url</li>
<li class="fn"><b><b><a href="qml-positionsource.html#position-prop">position</a></b></b> : Position</li>
<li class="fn"><b><b><a href="qml-positionsource.html#positioningMethod-prop">positioningMethod</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-positionsource.html#updateInterval-prop">updateInterval</a></b></b> : bool</li>
</ul>
<a name="signal-handlers"></a>
<h2>Signal Handlers</h2>
<ul>
<li class="fn"><b><b><a href="qml-positionsource.html#positionChanged-signal">positionChanged</a></b></b></li>
</ul>
<a name="methods"></a>
<h2>Methods</h2>
<ul>
<li class="fn"><b><b><a href="qml-positionsource.html#start-method">start</a></b></b></li>
<li class="fn"><b><b><a href="qml-positionsource.html#stop-method">stop</a></b></b></li>
<li class="fn"><b><b><a href="qml-positionsource.html#update-method">update</a></b></b></li>
</ul>
<!-- $$$PositionSource-description -->
<a name="details"></a>
<h2>Detailed Description</h2>
<p>The PositionSource element allows you to get information about your current position. You can receive information about things such as latitude, longitude, altitude, and speed. This element is part of the <b>QtMobility.location 1.1</b> module.</p>
<p>Support for location sources are platform dependant. When declaring a PositionSource element, a default PositionSource source shall be created. Supported positioning methods are held in <a href="qml-positionsource.html#positioningMethod-prop">positioningMethod</a>. As a development convenience, one may also set data file as a source (NMEA format). Location updates are not necessarily started automatically upon element declaration, see <a href="qml-positionsource.html#start-method">start</a> <a href="qml-positionsource.html#stop-method">stop</a> <a href="qml-positionsource.html#active-prop">active</a> and <a href="qml-positionsource.html#update-method">update</a>.</p>
<p>Here is very simple example QML to illustrate the usage:</p>
<pre class="qml"> import Qt 4.7
 import QtMobility.location 1.1

 <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-rectangle.html">Rectangle</a></span> {
         <span class="name">id</span>: <span class="name">page</span>
         <span class="name">width</span>: <span class="number">350</span>
         <span class="name">height</span>: <span class="number">350</span>
         <span class="type">PositionSource</span> {
             <span class="name">id</span>: <span class="name">positionSource</span>
             <span class="name">updateInterval</span>: <span class="number">1000</span>
             <span class="name">active</span>: <span class="number">true</span>
             <span class="comment">// nmeaSource: &quot;nmealog.txt&quot;</span>
         }
         <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-column.html">Column</a></span> {
             <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-text.html">Text</a></span> {<span class="name">text</span>: <span class="string">&quot;&lt;==== PositionSource ====&gt;&quot;</span>}
             <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-text.html">Text</a></span> {<span class="name">text</span>: <span class="string">&quot;positioningMethod: &quot;</span>  <span class="operator">+</span> <span class="name">printableMethod</span>(<span class="name">positionSource</span>.<span class="name">positioningMethod</span>)}
             <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-text.html">Text</a></span> {<span class="name">text</span>: <span class="string">&quot;nmeaSource: &quot;</span>         <span class="operator">+</span> <span class="name">positionSource</span>.<span class="name">nmeaSource</span>}
             <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-text.html">Text</a></span> {<span class="name">text</span>: <span class="string">&quot;updateInterval: &quot;</span>     <span class="operator">+</span> <span class="name">positionSource</span>.<span class="name">updateInterval</span>}
             <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-text.html">Text</a></span> {<span class="name">text</span>: <span class="string">&quot;active: &quot;</span>     <span class="operator">+</span> <span class="name">positionSource</span>.<span class="name">active</span>}
             <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-text.html">Text</a></span> {<span class="name">text</span>: <span class="string">&quot;&lt;==== Position ====&gt;&quot;</span>}
             <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-text.html">Text</a></span> {<span class="name">text</span>: <span class="string">&quot;latitude: &quot;</span>   <span class="operator">+</span> <span class="name">positionSource</span>.<span class="name">position</span>.<span class="name">coordinate</span>.<span class="name">latitude</span>}
             <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-text.html">Text</a></span> {<span class="name">text</span>: <span class="string">&quot;longitude: &quot;</span>   <span class="operator">+</span> <span class="name">positionSource</span>.<span class="name">position</span>.<span class="name">coordinate</span>.<span class="name">longitude</span>}
             <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-text.html">Text</a></span> {<span class="name">text</span>: <span class="string">&quot;altitude: &quot;</span>   <span class="operator">+</span> <span class="name">positionSource</span>.<span class="name">position</span>.<span class="name">coordinate</span>.<span class="name">altitude</span>}
             <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-text.html">Text</a></span> {<span class="name">text</span>: <span class="string">&quot;speed: &quot;</span> <span class="operator">+</span> <span class="name">positionSource</span>.<span class="name">position</span>.<span class="name">speed</span>}
             <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-text.html">Text</a></span> {<span class="name">text</span>: <span class="string">&quot;timestamp: &quot;</span>  <span class="operator">+</span> <span class="name">positionSource</span>.<span class="name">position</span>.<span class="name">timestamp</span>}
             <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-text.html">Text</a></span> {<span class="name">text</span>: <span class="string">&quot;altitudeValid: &quot;</span>  <span class="operator">+</span> <span class="name">positionSource</span>.<span class="name">position</span>.<span class="name">altitudeValid</span>}
             <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-text.html">Text</a></span> {<span class="name">text</span>: <span class="string">&quot;longitudeValid: &quot;</span>  <span class="operator">+</span> <span class="name">positionSource</span>.<span class="name">position</span>.<span class="name">longitudeValid</span>}
             <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-text.html">Text</a></span> {<span class="name">text</span>: <span class="string">&quot;latitudeValid: &quot;</span>  <span class="operator">+</span> <span class="name">positionSource</span>.<span class="name">position</span>.<span class="name">latitudeValid</span>}
             <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-text.html">Text</a></span> {<span class="name">text</span>: <span class="string">&quot;speedValid: &quot;</span>     <span class="operator">+</span> <span class="name">positionSource</span>.<span class="name">position</span>.<span class="name">speedValid</span>}
         }
         <span class="keyword">function</span> <span class="name">printableMethod</span>(<span class="name">method</span>) {
             <span class="keyword">if</span> (<span class="name">method</span> <span class="operator">==</span> <span class="name">PositionSource</span>.<span class="name">SatellitePositioningMethod</span>)
                 <span class="keyword">return</span> <span class="string">&quot;Satellite&quot;</span>;
             else <span class="keyword">if</span> (<span class="name">method</span> <span class="operator">==</span> <span class="name">PositionSource</span>.<span class="name">NoPositioningMethod</span>)
                 <span class="keyword">return</span> <span class="string">&quot;Not available&quot;</span>
             else <span class="keyword">if</span> (<span class="name">method</span> <span class="operator">==</span> <span class="name">PositionSource</span>.<span class="name">NonSatellitePositioningMethod</span>)
                 <span class="keyword">return</span> <span class="string">&quot;Non-satellite&quot;</span>
             else <span class="keyword">if</span> (<span class="name">method</span> <span class="operator">==</span> <span class="name">PositionSource</span>.<span class="name">AllPositioningMethods</span>)
                 <span class="keyword">return</span> <span class="string">&quot;All/multiple&quot;</span>
             <span class="keyword">return</span> <span class="string">&quot;source error&quot;</span>;
         }
     }</pre>
<p><b>See also </b><a href="qgeopositioninfosource.html">QGeoPositionInfoSource</a>, <a href="qgeopositioninfo.html">QGeoPositionInfo</a>, <a href="qnmeapositioninfosource.html">QNmeaPositionInfoSource</a>, and <a href="qgeocoordinate.html">QGeoCoordinate</a>.</p>
<!-- @@@PositionSource -->
<h2>Property Documentation</h2>
<!-- $$$active -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="active-prop"></a><span class="name">active</span> : <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-bool.html">bool</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property indicates whether the position source is (/should be) active. Setting this property to false equals calling <a href="qml-positionsource.html#stop-method">stop</a>, and setting this property true equals calling <a href="qml-positionsource.html#start-method">start</a>.</p>
<p>This property group was introduced in  Mobility 1.2.</p>
<p><b>See also </b><a href="qml-positionsource.html#start-method">start</a>, <a href="qml-positionsource.html#stop-method">stop</a>, and <a href="qml-positionsource.html#update-method">update</a>.</p>
</div></div><!-- @@@active -->
<br/>
<!-- $$$nmeaSource -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="nmeaSource-prop"></a><span class="name">nmeaSource</span> : <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-url.html">url</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the source for NMEA data (file). One purpose of this property is to be of development convenience.</p>
<p>Setting this property will override any other position source. Currently only files local to the .qml -file are supported. Nmea source is created in simulation mode, meaning that the data and time information in the NMEA source data is used to provide positional updates at the rate at which the data was originally recorded.</p>
<p>If nmeaSource has been set for a <a href="qml-positionsource.html">PositionSource</a> element, there is no way to revert back to non-file sources.</p>
<p>This property group was introduced in  Mobility 1.2.</p>
</div></div><!-- @@@nmeaSource -->
<br/>
<!-- $$$position -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="position-prop"></a><span class="name">position</span> : <span class="type"><a href="qml-position.html">Position</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the last known positional data.</p>
<p>The Position element has different positional member variables, whose validity can be checked with appropriate validity functions (e.g&#x2e; sometimes an update does not have speed or altitude data).</p>
<p>However, whenever a <a href="qml-positionsource.html#positionChanged-signal">positionChanged</a> signal has been received, at least position::coordinate::latitude, position::coordinate::longitude, and position::timestamp can be assumed to be valid.</p>
<p>This property group was introduced in  Mobility 1.2.</p>
<p><b>See also </b><a href="qml-positionsource.html#start-method">start</a>, <a href="qml-positionsource.html#stop-method">stop</a>, and <a href="qml-positionsource.html#update-method">update</a>.</p>
</div></div><!-- @@@position -->
<br/>
<!-- $$$positioningMethod -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="positioningMethod-prop"></a><span class="name">positioningMethod</span> : <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-enumeration.html">enumeration</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the supported positioning methods of the current source.</p>
<ul>
<li>NoPositioningMethod - No positioning methods supported (no source).</li>
<li>SatellitePositioningMethod - Satellite-based positioning methods such as GPS is supported.</li>
<li>NonSatellitePositioningMethod - Non satellite methods are supported.</li>
<li>AllPositioningMethods - Combination of methods are supported.</li>
</ul>
<p>This property group was introduced in  Mobility 1.2.</p>
</div></div><!-- @@@positioningMethod -->
<br/>
<!-- $$$updateInterval -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="updateInterval-prop"></a><span class="name">updateInterval</span> : <span class="type"><a href="http://qt.nokia.com/doc/4.7/qml-bool.html">bool</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the desired interval between updates (milliseconds).</p>
<p>This property group was introduced in  Mobility 1.2.</p>
<p><b>See also </b><a href="qgeopositioninfosource.html#updateInterval-prop">QGeoPositionInfoSource::updateInterval()</a>.</p>
</div></div><!-- @@@updateInterval -->
<br/>
<h2>Signal Handler Documentation</h2>
<!-- $$$positionChanged -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="positionChanged-signal"></a>PositionSource::<span class="name">positionChanged</span> ()</p></td></tr></table></div><div class="qmldoc"><p>This signal is sent when a position update has been received from the location source. Upon receiving this signal, at least position::latitude, position::longitude, and position::timestamp members of the <a href="qml-positionsource.html#position-prop">position</a> have been updated.</p>
<p>This documentation was introduced in  Mobility 1.2.</p>
<p><b>See also </b><a href="qml-positionsource.html#updateInterval-prop">updateInterval</a>.</p>
</div></div><!-- @@@positionChanged -->
<br/>
<h2>Method Documentation</h2>
<!-- $$$start -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="start-method"></a>PositionSource::<span class="name">start</span> ()</p></td></tr></table></div><div class="qmldoc"><p>Requests updates from the location source. Uses <a href="qml-positionsource.html#updateInterval-prop">updateInterval</a> if set, default interval otherwise. If there is no source available, this method has no effect.</p>
<p>This documentation was introduced in  Mobility 1.2.</p>
<p><b>See also </b><a href="qml-positionsource.html#stop-method">stop</a>, <a href="qml-positionsource.html#update-method">update</a>, and <a href="qml-positionsource.html#active-prop">active</a>.</p>
</div></div><!-- @@@start -->
<br/>
<!-- $$$stop -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="stop-method"></a>PositionSource::<span class="name">stop</span> ()</p></td></tr></table></div><div class="qmldoc"><p>Stops updates from the location source. If there is no source available or it is not active, this method has no effect.</p>
<p>This documentation was introduced in  Mobility 1.2.</p>
<p><b>See also </b><a href="qml-positionsource.html#start-method">start</a>, <a href="qml-positionsource.html#update-method">update</a>, and <a href="qml-positionsource.html#active-prop">active</a>.</p>
</div></div><!-- @@@stop -->
<br/>
<!-- $$$update -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="update-method"></a>PositionSource::<span class="name">update</span> ()</p></td></tr></table></div><div class="qmldoc"><p>A convenience method to request single update from the location source. If there is no source available, this method has no effect.</p>
<p>This documentation was introduced in  Mobility 1.2.</p>
<p><b>See also </b><a href="qml-positionsource.html#start-method">start</a>, <a href="qml-positionsource.html#stop-method">stop</a>, and <a href="qml-positionsource.html#active-prop">active</a>.</p>
</div></div><!-- @@@update -->
<br/>
<p class="naviNextPrevious footerNavi">
</p>
  <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>