/usr/share/qt5/doc/qtpositioning/location-positioning-cpp.html is in qtlocation5-doc-html 5.2.1-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.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" />
<!-- cpp-position.qdoc -->
<title>Positioning (C++) | QtPositioning 5.2</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="main">
<div class="main-rounded">
<div class="navigationbar">
<ul>
<li>Qt 5.2</li>
<li><a href="qtpositioning-index.html">Qt Positioning</a></li>
<li>Positioning (C++)</li>
<li id="buildversion">
Qt 5.2.1 Reference Documentation</li>
</ul>
</div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#positioning">Positioning</a></li>
<li class="level2"><a href="#requesting-location-data-from-data-sources">Requesting Location Data from Data Sources</a></li>
<li class="level2"><a href="#controlling-aspects-of-data-sources">Controlling Aspects of Data Sources</a></li>
<li class="level2"><a href="#nmea-data">NMEA Data</a></li>
<li class="level1"><a href="#examples">Examples</a></li>
<li class="level3"><a href="#flickr-example"><b>Flickr Example</b></a></li>
<li class="level1"><a href="#positioning-classes">Positioning Classes</a></li>
</ul>
</div>
<h1 class="title">Positioning (C++)</h1>
<span class="subtitle"></span>
<!-- $$$location-positioning-cpp.html-description -->
<div class="descr"> <a name="details"></a>
<a name="positioning"></a>
<h2>Positioning</h2>
<p>The Positioning component of the Qt Location API is about the geographical position, size and address of some place. Positioning contains a <a href="qgeocoordinate.html">QGeoCoordinate</a> class, containing latitude, longitude and altitude in meters. <a href="qgeolocation.html">QGeoLocation</a> contains a <a href="qgeocoordinate.html">QGeoCoordinate</a> plus address and size information (a bounding box) so that positions can be more than mathematical points. Movement into or out of the defined bounding box areas can be monitored. The API also allows the developer to control the source of the positional information as well.</p>
<p>Location data involves a precisely specified position on the Earth's surface — as provided by a latitude-longitude coordinate — along with associated data, such as:</p>
<ul>
<li>The date and time at which the position was reported</li>
<li>The velocity of the device that reported the position</li>
<li>The altitude of the reported position (height above sea level)</li>
<li>The bearing of the device in degrees, relative to true north</li>
</ul>
<p>This data can be extracted through a variety of methods. One of the most well known methods of positioning is GPS (Global Positioning System), a publicly available system that uses radiowave signals received from Earth-orbiting satellites to calculate the precise position and time of the receiver. Another popular method is 'Cell Identifier Positioning', which uses the cell identifier of the cell site that is currently serving the receiving device to calculate its approximate location. These and other positioning methods can all be used with the Location API; the only requirement for a location data source within the API is that it provides a latitude-longitude coordinate with a date/time value, with the option of providing the other attributes listed above.</p>
<p>Location data sources are created by subclassing <a href="qgeopositioninfosource.html">QGeoPositionInfoSource</a> and providing <a href="qgeopositioninfo.html">QGeoPositionInfo</a> objects through the <a href="qgeopositioninfosource.html#positionUpdated">QGeoPositionInfoSource::positionUpdated</a>() signal. Clients that require location data can connect to the <a href="qgeopositioninfosource.html#positionUpdated">positionUpdated()</a> signal and call <a href="qgeopositioninfosource.html#startUpdates">startUpdates()</a> or <a href="qgeopositioninfosource.html#requestUpdate">requestUpdate()</a> to trigger the distribution of location data. The location data distribution can be stopped by calling the <a href="qgeopositioninfosource.html#stopUpdates">stopUpdates()</a> function.</p>
<p>A default position source may be available on some platforms. Call <a href="qgeopositioninfosource.html#createDefaultSource">QGeoPositionInfoSource::createDefaultSource</a>() to create an instance of the default position source; the method returns 0 if no default source is available for the platform.</p>
<p>If a problem occurs with access to the information source then an <a href="qgeopositioninfosource.html#error">error()</a> signal is emitted.</p>
<p>The <a href="qgeoareamonitorsource.html">QGeoAreaMonitorSource</a> class enables client applications to be notified when the receiving device has moved in or out of a particular area, as specified by a coordinate and radius. If the platform provides built-in support for area monitoring, QGeoAreaMonitorSource::createDefaultMonitor() returns an instance of the default area monitor.</p>
<p>Satellite information can also be distributed through the <a href="qgeosatelliteinfosource.html">QGeoSatelliteInfoSource</a> class. Call <a href="qgeosatelliteinfosource.html#createDefaultSource">QGeoSatelliteInfoSource::createDefaultSource</a>() to create an instance of the default satellite data source for the platform, if one is available. Alternatively, clients can subclass it to provide a custom satellite data source.</p>
<a name="requesting-location-data-from-data-sources"></a>
<h3>Requesting Location Data from Data Sources</h3>
<p>To receive data from a source, connect to its <a href="qgeopositioninfosource.html#positionUpdated">positionUpdated()</a> signal, then call either <a href="qgeopositioninfosource.html#startUpdates">startUpdates()</a> or <a href="qgeopositioninfosource.html#requestUpdate">requestUpdate()</a> to begin.</p>
<p>Here is an example of a client that receives data from the default location data source, as returned by <a href="qgeopositioninfosource.html#createDefaultSource">QGeoPositionInfoSource::createDefaultSource</a>():</p>
<pre class="cpp"><span class="keyword">class</span> MyClass : <span class="keyword">public</span> <span class="type">QObject</span>
{
Q_OBJECT
<span class="keyword">public</span>:
MyClass(<span class="type">QObject</span> <span class="operator">*</span>parent <span class="operator">=</span> <span class="number">0</span>)
: <span class="type">QObject</span>(parent)
{
<span class="type"><a href="qgeopositioninfosource.html">QGeoPositionInfoSource</a></span> <span class="operator">*</span>source <span class="operator">=</span> <span class="type"><a href="qgeopositioninfosource.html">QGeoPositionInfoSource</a></span><span class="operator">::</span>createDefaultSource(<span class="keyword">this</span>);
<span class="keyword">if</span> (source) {
connect(source<span class="operator">,</span> SIGNAL(positionUpdated(<span class="type"><a href="qgeopositioninfo.html">QGeoPositionInfo</a></span>))<span class="operator">,</span>
<span class="keyword">this</span><span class="operator">,</span> SLOT(positionUpdated(<span class="type"><a href="qgeopositioninfo.html">QGeoPositionInfo</a></span>)));
source<span class="operator">-</span><span class="operator">></span>startUpdates();
}
}
<span class="keyword">private</span> <span class="keyword">slots</span>:
<span class="type">void</span> positionUpdated(<span class="keyword">const</span> <span class="type"><a href="qgeopositioninfo.html">QGeoPositionInfo</a></span> <span class="operator">&</span>info)
{
qDebug() <span class="operator"><</span><span class="operator"><</span> <span class="string">"Position updated:"</span> <span class="operator"><</span><span class="operator"><</span> info;
}
};</pre>
<a name="controlling-aspects-of-data-sources"></a>
<h3>Controlling Aspects of Data Sources</h3>
<p>The <a href="qgeopositioninfosource.html#updateInterval-prop">QGeoPositionInfoSource::setUpdateInterval</a>() method can be used to control the rate at which position updates are received. For example, if the client application only requires updates once every 30 seconds, it can call <tt>setUpdateInterval(30000)</tt>. (If no update interval is set, or <a href="qgeopositioninfosource.html#updateInterval-prop">setUpdateInterval()</a> is called with a value of 0, the source uses a default interval or some other internal logic to determine when updates should be provided.)</p>
<p><a href="qgeopositioninfosource.html#setPreferredPositioningMethods">QGeoPositionInfoSource::setPreferredPositioningMethods</a>() enables client applications to request that a certain type of positioning method be used. For example, if the application prefers to use only satellite positioning, which offers fairly precise outdoor positioning but can be a heavy user of power resources, it can call this method with the <a href="qgeopositioninfosource.html#PositioningMethod-enum">QGeoPositionInfoSource::SatellitePositioningMethods</a> value. However, this method should only be used in specialized client applications; in most cases, the default positioning methods should not be changed, as a source may internally use a variety of positioning methods that can be useful to the application.</p>
<a name="nmea-data"></a>
<h3>NMEA Data</h3>
<p><a href="http://en.wikipedia.org/wiki/NMEA_0183">NMEA</a> is a common text-based protocol for specifying navigational data. For convenience, the <a href="qnmeapositioninfosource.html">QNmeaPositionInfoSource</a> is provided to enable client applications to read and distribute NMEA data in either real-time mode (for example, when streaming from a GPS device) or simulation mode (for example, when reading from a NMEA log file). In simulation mode, the source will emit updates according to the time stamp of each NMEA sentence to produce a "replay" of the recorded data.</p>
<p>Generally, the capabilities provided by the default position source as returned by <a href="qgeopositioninfosource.html#createDefaultSource">QGeoPositionInfoSource::createDefaultSource</a>(), along with the <a href="qnmeapositioninfosource.html">QNmeaPositionInfoSource</a> class, are sufficient for retrieving location data. However, in some cases developers may wish to write their own custom location data source.</p>
<p>The <a href="qtpositioning-logfilepositionsource-example.html">Log File Position Source (C++)</a> example demonstrates how to subclass <a href="qgeopositioninfosource.html">QGeoPositionInfoSource</a> to create a custom positioning source.</p>
<a name="examples"></a>
<h2>Examples</h2>
<a name="flickr-example"></a>
<h4><b>Flickr Example</b></h4>
<p>The <a href="qtpositioning-flickr-example.html">Flickr Example</a> uses the Location to download thumbnail images from Flickr relevant to the current location.</p>
<a name="positioning-classes"></a>
<h2>Positioning Classes</h2>
<table class="annotated">
<tr class="odd topAlign"><td class="tblName"><p><a href="qgeoaddress.html">QGeoAddress</a></p></td><td class="tblDescr"><p>Represents an address of a QGeoLocation</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qgeoareamonitorinfo.html">QGeoAreaMonitorInfo</a></p></td><td class="tblDescr"><p>Describes the parameters of an area or region to be monitored for proximity</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qgeoareamonitorsource.html">QGeoAreaMonitorSource</a></p></td><td class="tblDescr"><p>Enables the detection of proximity changes for a specified set of coordinates</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qgeocircle.html">QGeoCircle</a></p></td><td class="tblDescr"><p>Defines a circular geographic area</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qgeocoordinate.html">QGeoCoordinate</a></p></td><td class="tblDescr"><p>Defines a geographical position on the surface of the Earth</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qgeolocation.html">QGeoLocation</a></p></td><td class="tblDescr"><p>Represents basic information about a location</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qgeopositioninfo.html">QGeoPositionInfo</a></p></td><td class="tblDescr"><p>Contains information gathered on a global position, direction and velocity at a particular point in time</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qgeopositioninfosource.html">QGeoPositionInfoSource</a></p></td><td class="tblDescr"><p>Abstract base class for the distribution of positional updates</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qgeorectangle.html">QGeoRectangle</a></p></td><td class="tblDescr"><p>Defines a rectangular geographic area</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qgeosatelliteinfo.html">QGeoSatelliteInfo</a></p></td><td class="tblDescr"><p>Contains basic information about a satellite</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qgeosatelliteinfosource.html">QGeoSatelliteInfoSource</a></p></td><td class="tblDescr"><p>Abstract base class for the distribution of satellite information updates</p></td></tr>
<tr class="even topAlign"><td class="tblName"><p><a href="qgeoshape.html">QGeoShape</a></p></td><td class="tblDescr"><p>Defines a geographic area</p></td></tr>
<tr class="odd topAlign"><td class="tblName"><p><a href="qnmeapositioninfosource.html">QNmeaPositionInfoSource</a></p></td><td class="tblDescr"><p>Positional information using a NMEA data source</p></td></tr>
</table>
</div>
<!-- @@@location-positioning-cpp.html -->
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2013 Digia Plc and/or its
subsidiaries. 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> Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. </p>
</div>
</body>
</html>
|