/usr/share/qt5/doc/qtpositioning/qml-qtpositioning-positionsource.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 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | <?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" />
<!-- qdeclarativepositionsource.cpp -->
<title>PositionSource | 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><a href="qtpositioning-qmlmodule.html">QML Types</a></li>
<li>PositionSource</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="#properties">Properties</a></li>
<li class="level1"><a href="#methods">Methods</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#example-usage">Example Usage</a></li>
</ul>
</div>
<h1 class="title">PositionSource</h1>
<span class="subtitle"></span>
<!-- $$$PositionSource-brief -->
<p>The PositionSource type provides the device's current position. <a href="#details">More...</a></p>
<!-- @@@PositionSource -->
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> </b><tt>import QtPositioning 5.2</tt></td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign"> Qt 5.2</td></tr></table><ul>
<li><a href="qml-qtpositioning-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-qtpositioning-positionsource.html#active-prop">active</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtpositioning-positionsource.html#name-prop">name</a></b></b> : string</li>
<li class="fn"><b><b><a href="qml-qtpositioning-positionsource.html#nmeaSource-prop">nmeaSource</a></b></b> : url</li>
<li class="fn"><b><b><a href="qml-qtpositioning-positionsource.html#position-prop">position</a></b></b> : Position</li>
<li class="fn"><b><b><a href="qml-qtpositioning-positionsource.html#preferredPositioningMethods-prop">preferredPositioningMethods</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-qtpositioning-positionsource.html#sourceError-prop">sourceError</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-qtpositioning-positionsource.html#supportedPositioningMethods-prop">supportedPositioningMethods</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-qtpositioning-positionsource.html#updateInterval-prop">updateInterval</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-qtpositioning-positionsource.html#valid-prop">valid</a></b></b> : bool</li>
</ul>
<a name="methods"></a>
<h2>Methods</h2>
<ul>
<li class="fn"><b><b><a href="qml-qtpositioning-positionsource.html#start-method">start</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtpositioning-positionsource.html#stop-method">stop</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtpositioning-positionsource.html#update-method">update</a></b></b>()</li>
</ul>
<!-- $$$PositionSource-description -->
<a name="details"></a>
<h2>Detailed Description</h2>
<p>The PositionSource type provides information about the user device's current position. The position is available as a <a href="qml-qtpositioning-position.html">Position</a> type, which contains all the standard parameters typically available from GPS and other similar systems, including longitude, latitude, speed and accuracy details.</p>
<p>As different position sources are available on different platforms and devices, these are categorized by their basic type (Satellite, NonSatellite, and AllPositioningMethods). The available methods for the current platform can be enumerated in the <a href="qml-qtpositioning-positionsource.html#supportedPositioningMethods-prop">supportedPositioningMethods</a> property.</p>
<p>To indicate which methods are suitable for your application, set the <a href="qml-qtpositioning-positionsource.html#preferredPositioningMethods-prop">preferredPositioningMethods</a> property. If the preferred methods are not available, the default source of location data for the platform will be chosen instead. If no default source is available (because none are installed for the runtime platform, or because it is disabled), the <a href="qml-qtpositioning-positionsource.html#valid-prop">valid</a> property will be set to false.</p>
<p>The <a href="qml-qtpositioning-positionsource.html#updateInterval-prop">updateInterval</a> property can then be used to indicate how often your application wishes to receive position updates. The <a href="qml-qtpositioning-positionsource.html#start-method">start</a>(), <a href="qml-qtpositioning-positionsource.html#stop-method">stop</a>() and <a href="qml-qtpositioning-positionsource.html#update-method">update</a>() methods can be used to control the operation of the PositionSource, as well as the <a href="qml-qtpositioning-positionsource.html#active-prop">active</a> property, which when set is equivalent to calling <a href="qml-qtpositioning-positionsource.html#start-method">start</a>() or <a href="qml-qtpositioning-positionsource.html#stop-method">stop</a>().</p>
<p>When the PositionSource is active, position updates can be retrieved either by simply using the <a href="qml-qtpositioning-positionsource.html#position-prop">position</a> property in a binding (as the value of another item's property), or by providing an implementation of the <tt>onPositionChanged</tt> signal-handler.</p>
<a name="example-usage"></a>
<h3>Example Usage</h3>
<p>The following example shows a simple PositionSource used to receive updates every second and print the longitude and latitude out to the console.</p>
<pre class="cpp">PositionSource {
id: src
updateInterval: <span class="number">1000</span>
active: <span class="keyword">true</span>
onPositionChanged: {
var coord <span class="operator">=</span> src<span class="operator">.</span>position<span class="operator">.</span>coordinate;
console<span class="operator">.</span>log(<span class="string">"Coordinate:"</span><span class="operator">,</span> coord<span class="operator">.</span>longitude<span class="operator">,</span> coord<span class="operator">.</span>latitude);
}
}</pre>
<p>The <a href="qtpositioning-flickr-example.html">Flickr</a> example application shows how to use a PositionSource in your application to retrieve local data for users from a REST web service.</p>
<p><b>See also </b><a href="qml-qtpositioning-position.html">QtPositioning::Position</a> and <a href="qgeopositioninfosource.html">QGeoPositionInfoSource</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">bool</span></p></td></tr></table></div><div class="qmldoc"><p>This property indicates whether the position source is active. Setting this property to false equals calling <a href="qml-qtpositioning-positionsource.html#stop-method">stop</a>, and setting this property true equals calling <a href="qml-qtpositioning-positionsource.html#start-method">start</a>.</p>
<p><b>See also </b><a href="qml-qtpositioning-positionsource.html#start-method">start</a>, <a href="qml-qtpositioning-positionsource.html#stop-method">stop</a>, and <a href="qml-qtpositioning-positionsource.html#update-method">update</a>.</p>
</div></div><!-- @@@active -->
<br/>
<!-- $$$name -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="name-prop"></a><span class="name">name</span> : <span class="type">string</span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the unique internal name for the plugin currently providing position information.</p>
<p>Setting the property causes the <a href="qml-qtpositioning-positionsource.html">PositionSource</a> to use a particular positioning provider. If the <a href="qml-qtpositioning-positionsource.html">PositionSource</a> is active at the time that the name property is changed, it will become inactive. If the specified positioning provider cannot be loaded the position source will become invalid.</p>
<p>Changing the name property may cause the <a href="qml-qtpositioning-positionsource.html#updateInterval-prop">updateInterval</a>, <a href="qml-qtpositioning-positionsource.html#supportedPositioningMethods-prop">supportedPositioningMethods</a> and <a href="qml-qtpositioning-positionsource.html#preferredPositioningMethods-prop">preferredPositioningMethods</a> properties to change as well.</p>
</div></div><!-- @@@name -->
<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">url</span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the source for NMEA (National Marine Electronics Association) position-specification 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. The 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-qtpositioning-positionsource.html">PositionSource</a> object, there is no way to revert back to non-file sources.</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-qtpositioning-position.html">Position</a></span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the last known positional data. It is a read-only property.</p>
<p>The Position type has different positional member variables, whose validity can be checked with appropriate validity functions (for example sometimes an update does not have speed or altitude data).</p>
<p>However, whenever a <tt>positionChanged</tt> signal has been received, at least position::coordinate::latitude, position::coordinate::longitude, and position::timestamp can be assumed to be valid.</p>
<p><b>See also </b><a href="qml-qtpositioning-positionsource.html#start-method">start</a>, <a href="qml-qtpositioning-positionsource.html#stop-method">stop</a>, and <a href="qml-qtpositioning-positionsource.html#update-method">update</a>.</p>
</div></div><!-- @@@position -->
<br/>
<!-- $$$preferredPositioningMethods -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="preferredPositioningMethods-prop"></a><span class="name">preferredPositioningMethods</span> : <span class="type">enumeration</span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the preferred positioning methods of the current source.</p>
<ul>
<li><a href="qml-qtpositioning-positionsource.html">PositionSource</a>.NoPositioningMethods - No positioning method is preferred.</li>
<li><a href="qml-qtpositioning-positionsource.html">PositionSource</a>.SatellitePositioningMethods - Satellite-based positioning methods such as GPS should be preferred.</li>
<li><a href="qml-qtpositioning-positionsource.html">PositionSource</a>.NonSatellitePositioningMethods - Non-satellite-based methods should be preferred.</li>
<li><a href="qml-qtpositioning-positionsource.html">PositionSource</a>.AllPositioningMethods - Any positioning methods are acceptable.</li>
</ul>
</div></div><!-- @@@preferredPositioningMethods -->
<br/>
<!-- $$$sourceError -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="sourceError-prop"></a><span class="name">sourceError</span> : <span class="type">enumeration</span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the error which last occured with the <a href="qml-qtpositioning-positionsource.html">PositionSource</a>.</p>
<ul>
<li><a href="qml-qtpositioning-positionsource.html">PositionSource</a>.AccessError - The connection setup to the remote positioning backend failed because the application lacked the required privileges.</li>
<li><a href="qml-qtpositioning-positionsource.html">PositionSource</a>.ClosedError - The positioning backend closed the connection, which happens for example in case the user is switching location services to off. As soon as the location service is re-enabled regular updates will resume.</li>
<li><a href="qml-qtpositioning-positionsource.html">PositionSource</a>.NoError - No error has occurred.</li>
<li><a href="qml-qtpositioning-positionsource.html">PositionSource</a>.UnknownSourceError - An unidentified error occurred.</li>
<li><a href="qml-qtpositioning-positionsource.html">PositionSource</a>.SocketError - An error occurred while connecting to an nmea source using a socket.</li>
</ul>
</div></div><!-- @@@sourceError -->
<br/>
<!-- $$$supportedPositioningMethods -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="supportedPositioningMethods-prop"></a><span class="name">supportedPositioningMethods</span> : <span class="type">enumeration</span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the supported positioning methods of the current source.</p>
<ul>
<li><a href="qml-qtpositioning-positionsource.html">PositionSource</a>.NoPositioningMethods - No positioning methods supported (no source).</li>
<li><a href="qml-qtpositioning-positionsource.html">PositionSource</a>.SatellitePositioningMethods - Satellite-based positioning methods such as GPS are supported.</li>
<li><a href="qml-qtpositioning-positionsource.html">PositionSource</a>.NonSatellitePositioningMethods - Non-satellite-based methods are supported.</li>
<li><a href="qml-qtpositioning-positionsource.html">PositionSource</a>.AllPositioningMethods - Both satellite-based and non-satellite positioning methods are supported.</li>
</ul>
</div></div><!-- @@@supportedPositioningMethods -->
<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">int</span></p></td></tr></table></div><div class="qmldoc"><p>This property holds the desired interval between updates (milliseconds).</p>
<p><b>See also </b><a href="qgeopositioninfosource.html#updateInterval-prop">QGeoPositionInfoSource::updateInterval()</a>.</p>
</div></div><!-- @@@updateInterval -->
<br/>
<!-- $$$valid -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="valid-prop"></a><span class="name">valid</span> : <span class="type">bool</span></p></td></tr></table></div><div class="qmldoc"><p>This property is true if the <a href="qml-qtpositioning-positionsource.html">PositionSource</a> object has acquired a valid backend plugin to provide data. If false, other methods on the <a href="qml-qtpositioning-positionsource.html">PositionSource</a> will have no effect.</p>
<p>Applications should check this property to determine whether positioning is available and enabled on the runtime platform, and react accordingly.</p>
</div></div><!-- @@@valid -->
<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><span class="name">start</span>()</p></td></tr></table></div><div class="qmldoc"><p>Requests updates from the location source. Uses <a href="qml-qtpositioning-positionsource.html#updateInterval-prop">updateInterval</a> if set, default interval otherwise. If there is no source available, this method has no effect.</p>
<p><b>See also </b><a href="qml-qtpositioning-positionsource.html#stop-method">stop</a>, <a href="qml-qtpositioning-positionsource.html#update-method">update</a>, and <a href="qml-qtpositioning-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><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><b>See also </b><a href="qml-qtpositioning-positionsource.html#start-method">start</a>, <a href="qml-qtpositioning-positionsource.html#update-method">update</a>, and <a href="qml-qtpositioning-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><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>If the position source is not active, it will be activated for as long as it takes to receive an update, or until the request times out. The request timeout period is source-specific.</p>
<p><b>See also </b><a href="qml-qtpositioning-positionsource.html#start-method">start</a>, <a href="qml-qtpositioning-positionsource.html#stop-method">stop</a>, and <a href="qml-qtpositioning-positionsource.html#active-prop">active</a>.</p>
</div></div><!-- @@@update -->
<br/>
</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>
|