/usr/share/qt5/doc/qtpositioning/qgeopositioninfosource.html is in qtlocation5-doc-html 5.5.1-3ubuntu1.
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 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qgeopositioninfosource.cpp -->
<title>QGeoPositionInfoSource Class | Qt Positioning 5.5</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.5</li>
<li><a href="qtpositioning-index.html">Qt Positioning</a></li>
<li><a href="qtpositioning-module.html">C++ Classes</a></li>
<li>QGeoPositionInfoSource</li>
<li id="buildversion">Qt 5.5.1 Reference Documentation</li>
</ul>
</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="#public-types">Public Types</a></li>
<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="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</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">QGeoPositionInfoSource Class</h1>
<!-- $$$QGeoPositionInfoSource-brief -->
<p>The <a href="qgeopositioninfosource.html">QGeoPositionInfoSource</a> class is an abstract base class for the distribution of positional updates. <a href="#details">More...</a></p>
<!-- @@@QGeoPositionInfoSource -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <QGeoPositionInfoSource></span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += positioning</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign"> Qt 5.2</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="../qtcore/qobject.html">QObject</a></td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherited By:</td><td class="memItemRight bottomAlign"> <p><a href="qnmeapositioninfosource.html">QNmeaPositionInfoSource</a></p>
</td></tr></table></div><ul>
<li><a href="qgeopositioninfosource-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qgeopositioninfosource.html#Error-enum">Error</a></b> { AccessError, ClosedError, NoError, UnknownSourceError }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qgeopositioninfosource.html#PositioningMethod-enum">PositioningMethod</a></b> { NoPositioningMethods, SatellitePositioningMethods, NonSatellitePositioningMethods, AllPositioningMethods }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> flags </td><td class="memItemRight bottomAlign"><b><a href="qgeopositioninfosource.html#PositioningMethod-enum">PositioningMethods</a></b></td></tr>
</table></div>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<ul>
<li class="fn"><b><a href="qgeopositioninfosource.html#minimumUpdateInterval-prop">minimumUpdateInterval</a></b> : const int</li>
<li class="fn"><b><a href="qgeopositioninfosource.html#sourceName-prop">sourceName</a></b> : const QString</li>
<li class="fn"><b><a href="qgeopositioninfosource.html#updateInterval-prop">updateInterval</a></b> : int</li>
</ul>
<ul>
<li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qgeopositioninfosource.html#QGeoPositionInfoSource">QGeoPositionInfoSource</a></b>(QObject *<i> parent</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qgeopositioninfosource.html#dtor.QGeoPositionInfoSource">~QGeoPositionInfoSource</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual Error </td><td class="memItemRight bottomAlign"><b><a href="qgeopositioninfosource.html#error">error</a></b>() const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QGeoPositionInfo </td><td class="memItemRight bottomAlign"><b><a href="qgeopositioninfosource.html#lastKnownPosition">lastKnownPosition</a></b>(bool<i> fromSatellitePositioningMethodsOnly</i> = false) const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual int </td><td class="memItemRight bottomAlign"><b><a href="qgeopositioninfosource.html#minimumUpdateInterval-prop">minimumUpdateInterval</a></b>() const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> PositioningMethods </td><td class="memItemRight bottomAlign"><b><a href="qgeopositioninfosource.html#preferredPositioningMethods">preferredPositioningMethods</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgeopositioninfosource.html#setPreferredPositioningMethods">setPreferredPositioningMethods</a></b>(PositioningMethods<i> methods</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgeopositioninfosource.html#updateInterval-prop">setUpdateInterval</a></b>(int<i> msec</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qgeopositioninfosource.html#sourceName-prop">sourceName</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual PositioningMethods </td><td class="memItemRight bottomAlign"><b><a href="qgeopositioninfosource.html#supportedPositioningMethods">supportedPositioningMethods</a></b>() const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qgeopositioninfosource.html#updateInterval-prop">updateInterval</a></b>() const</td></tr>
</table></div>
<ul>
<li class="fn">31 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li>
</ul>
<a name="public-slots"></a>
<h2 id="public-slots">Public Slots</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgeopositioninfosource.html#requestUpdate">requestUpdate</a></b>(int<i> timeout</i> = 0) = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgeopositioninfosource.html#startUpdates">startUpdates</a></b>() = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgeopositioninfosource.html#stopUpdates">stopUpdates</a></b>() = 0</td></tr>
</table></div>
<ul>
<li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgeopositioninfosource.html#error-2">error</a></b>(QGeoPositionInfoSource::Error<i> positioningError</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgeopositioninfosource.html#positionUpdated">positionUpdated</a></b>(const QGeoPositionInfo &<i> update</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgeopositioninfosource.html#updateTimeout">updateTimeout</a></b>()</td></tr>
</table></div>
<ul>
<li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li>
</ul>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qgeopositioninfosource.html#availableSources">availableSources</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGeoPositionInfoSource * </td><td class="memItemRight bottomAlign"><b><a href="qgeopositioninfosource.html#createDefaultSource">createDefaultSource</a></b>(QObject *<i> parent</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGeoPositionInfoSource * </td><td class="memItemRight bottomAlign"><b><a href="qgeopositioninfosource.html#createSource">createSource</a></b>(const QString &<i> sourceName</i>, QObject *<i> parent</i>)</td></tr>
</table></div>
<ul>
<li class="fn">10 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 public variable inherited from <a href="../qtcore/qobject.html#public-variables">QObject</a></li>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
<li class="fn">2 protected variables inherited from <a href="../qtcore/qobject.html#protected-variables">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QGeoPositionInfoSource-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qgeopositioninfosource.html">QGeoPositionInfoSource</a> class is an abstract base class for the distribution of positional updates.</p>
<p>The static function <a href="qgeopositioninfosource.html#createDefaultSource">QGeoPositionInfoSource::createDefaultSource</a>() creates a default position source that is appropriate for the platform, if one is available. Otherwise, <a href="qgeopositioninfosource.html">QGeoPositionInfoSource</a> will check for available plugins that implement the <a href="qgeopositioninfosourcefactory.html">QGeoPositionInfoSourceFactory</a> interface.</p>
<p>Users of a <a href="qgeopositioninfosource.html">QGeoPositionInfoSource</a> subclass can request the current position using <a href="qgeopositioninfosource.html#requestUpdate">requestUpdate</a>(), or start and stop regular position updates using <a href="qgeopositioninfosource.html#startUpdates">startUpdates</a>() and <a href="qgeopositioninfosource.html#stopUpdates">stopUpdates</a>(). When an update is available, <a href="qgeopositioninfosource.html#positionUpdated">positionUpdated</a>() is emitted. The last known position can be accessed with <a href="qgeopositioninfosource.html#lastKnownPosition">lastKnownPosition</a>().</p>
<p>If regular position updates are required, <a href="qgeopositioninfosource.html#updateInterval-prop">setUpdateInterval</a>() can be used to specify how often these updates should be emitted. If no interval is specified, updates are simply provided whenever they are available. For example:</p>
<pre class="cpp"><span class="comment">// Emit updates every 10 seconds if available</span>
<span class="type"><a href="qgeopositioninfosource.html#QGeoPositionInfoSource">QGeoPositionInfoSource</a></span> <span class="operator">*</span>source <span class="operator">=</span> <span class="type"><a href="qgeopositioninfosource.html#QGeoPositionInfoSource">QGeoPositionInfoSource</a></span><span class="operator">::</span><a href="qgeopositioninfosource.html#createDefaultSource">createDefaultSource</a>(<span class="number">0</span>);
<span class="keyword">if</span> (source)
source<span class="operator">-</span><span class="operator">></span><a href="qgeopositioninfosource.html#updateInterval-prop">setUpdateInterval</a>(<span class="number">10000</span>);</pre>
<p>To remove an update interval that was previously set, call <a href="qgeopositioninfosource.html#updateInterval-prop">setUpdateInterval</a>() with a value of 0.</p>
<p>Note that the position source may have a minimum value requirement for update intervals, as returned by <a href="qgeopositioninfosource.html#minimumUpdateInterval-prop">minimumUpdateInterval</a>().</p>
<p><b>Warning:</b> On Windows CE it is not possible to detect if a device is GPS enabled. The default position source on a Windows CE device without GPS support will never provide any position data.</p>
</div>
<!-- @@@QGeoPositionInfoSource -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$Error$$$AccessError$$$ClosedError$$$UnknownSourceError$$$NoError -->
<h3 class="fn" id="Error-enum"><a name="Error-enum"></a>enum QGeoPositionInfoSource::<span class="name">Error</span></h3>
<p>The Error enumeration represents the errors which can occur.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QGeoPositionInfoSource::AccessError</code></td><td class="topAlign"><code>0</code></td><td class="topAlign">The connection setup to the remote positioning backend failed because the application lacked the required privileges.</td></tr>
<tr><td class="topAlign"><code>QGeoPositionInfoSource::ClosedError</code></td><td class="topAlign"><code>1</code></td><td class="topAlign">The remote 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.</td></tr>
<tr><td class="topAlign"><code>QGeoPositionInfoSource::NoError</code></td><td class="topAlign"><code>3</code></td><td class="topAlign">No error has occurred.</td></tr>
<tr><td class="topAlign"><code>QGeoPositionInfoSource::UnknownSourceError</code></td><td class="topAlign"><code>2</code></td><td class="topAlign">An unidentified error occurred.</td></tr>
</table></div>
<!-- @@@Error -->
<!-- $$$PositioningMethod$$$NoPositioningMethods$$$SatellitePositioningMethods$$$NonSatellitePositioningMethods$$$AllPositioningMethods -->
<h3 class="flags" id="PositioningMethod-enum"><a name="PositioningMethod-enum"></a>enum QGeoPositionInfoSource::<span class="name">PositioningMethod</span><br/>flags QGeoPositionInfoSource::<span class="name">PositioningMethods</span></h3>
<p>Defines the types of positioning methods.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QGeoPositionInfoSource::NoPositioningMethods</code></td><td class="topAlign"><code>0x00000000</code></td><td class="topAlign">None of the positioning methods.</td></tr>
<tr><td class="topAlign"><code>QGeoPositionInfoSource::SatellitePositioningMethods</code></td><td class="topAlign"><code>0x000000ff</code></td><td class="topAlign">Satellite-based positioning methods such as GPS or GLONASS.</td></tr>
<tr><td class="topAlign"><code>QGeoPositionInfoSource::NonSatellitePositioningMethods</code></td><td class="topAlign"><code>0xffffff00</code></td><td class="topAlign">Other positioning methods such as 3GPP cell identifier or WiFi based positioning.</td></tr>
<tr><td class="topAlign"><code>QGeoPositionInfoSource::AllPositioningMethods</code></td><td class="topAlign"><code>0xffffffff</code></td><td class="topAlign">Satellite-based positioning methods as soon as available. Otherwise non-satellite based methods.</td></tr>
</table></div>
<p>The PositioningMethods type is a typedef for <a href="../qtcore/qflags.html">QFlags</a><PositioningMethod>. It stores an OR combination of PositioningMethod values.</p>
<!-- @@@PositioningMethod -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$minimumUpdateInterval-prop$$$minimumUpdateInterval -->
<h3 class="fn" id="minimumUpdateInterval-prop"><a name="minimumUpdateInterval-prop"></a><span class="name">minimumUpdateInterval</span> : const <span class="type">int</span></h3>
<p>This property holds this property holds the minimum time (in milliseconds) required to retrieve a position update.</p>
<p>This is the minimum value accepted by <a href="qgeopositioninfosource.html#updateInterval-prop">setUpdateInterval</a>() and <a href="qgeopositioninfosource.html#requestUpdate">requestUpdate</a>().</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> virtual int </td><td class="memItemRight bottomAlign"><span class="name"><b>minimumUpdateInterval</b></span>() const = 0</td></tr>
</table></div>
<!-- @@@minimumUpdateInterval -->
<!-- $$$sourceName-prop$$$sourceName -->
<h3 class="fn" id="sourceName-prop"><a name="sourceName-prop"></a><span class="name">sourceName</span> : const <span class="type"><a href="../qtcore/qstring.html">QString</a></span></h3>
<p>This property holds this property holds the unique name of the position source implementation in use.</p>
<p>This is the same name that can be passed to <a href="qgeopositioninfosource.html#createSource">createSource</a>() in order to create a new instance of a particular position source implementation.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>sourceName</b></span>() const</td></tr>
</table></div>
<!-- @@@sourceName -->
<!-- $$$updateInterval-prop$$$updateInterval$$$setUpdateIntervalint -->
<h3 class="fn" id="updateInterval-prop"><a name="updateInterval-prop"></a><span class="name">updateInterval</span> : <span class="type">int</span></h3>
<p>This property holds this property holds the requested interval in milliseconds between each update.</p>
<p>If the update interval is not set (or is set to 0) the source will provide updates as often as necessary.</p>
<p>If the update interval is set, the source will provide updates at an interval as close to the requested interval as possible. If the requested interval is less than the <a href="qgeopositioninfosource.html#minimumUpdateInterval-prop">minimumUpdateInterval</a>(), the minimum interval is used instead.</p>
<p>Changes to the update interval will happen as soon as is practical, however the time the change takes may vary between implementations. Whether or not the elapsed time from the previous interval is counted as part of the new interval is also implementation dependent.</p>
<p>The default value for this property is 0.</p>
<p>Note: Subclass implementations must call the base implementation of setUpdateInterval() so that updateInterval() returns the correct value.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>updateInterval</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> virtual void </td><td class="memItemRight bottomAlign"><span class="name"><b>setUpdateInterval</b></span>(int<i> msec</i>)</td></tr>
</table></div>
<!-- @@@updateInterval -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QGeoPositionInfoSource[overload1]$$$QGeoPositionInfoSourceQObject* -->
<h3 class="fn" id="QGeoPositionInfoSource"><a name="QGeoPositionInfoSource"></a>QGeoPositionInfoSource::<span class="name">QGeoPositionInfoSource</span>(<span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i> parent</i>)</h3>
<p>Creates a position source with the specified <i>parent</i>.</p>
<!-- @@@QGeoPositionInfoSource -->
<!-- $$$~QGeoPositionInfoSource[overload1]$$$~QGeoPositionInfoSource -->
<h3 class="fn" id="dtor.QGeoPositionInfoSource"><a name="dtor.QGeoPositionInfoSource"></a><code>[virtual] </code>QGeoPositionInfoSource::<span class="name">~QGeoPositionInfoSource</span>()</h3>
<p>Destroys the position source.</p>
<!-- @@@~QGeoPositionInfoSource -->
<!-- $$$availableSources[overload1]$$$availableSources -->
<h3 class="fn" id="availableSources"><a name="availableSources"></a><code>[static] </code><span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> QGeoPositionInfoSource::<span class="name">availableSources</span>()</h3>
<p>Returns a list of available source plugins. This includes any default backend plugin for the current platform.</p>
<!-- @@@availableSources -->
<!-- $$$createDefaultSource[overload1]$$$createDefaultSourceQObject* -->
<h3 class="fn" id="createDefaultSource"><a name="createDefaultSource"></a><code>[static] </code><span class="type"><a href="qgeopositioninfosource.html#QGeoPositionInfoSource">QGeoPositionInfoSource</a></span> * QGeoPositionInfoSource::<span class="name">createDefaultSource</span>(<span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i> parent</i>)</h3>
<p>Creates and returns a position source with the given <i>parent</i> that reads from the system's default sources of location data, or the plugin with the highest available priority.</p>
<p>Returns 0 if the system has no default position source, no valid plugins could be found or the user does not have the permission to access the current position.</p>
<!-- @@@createDefaultSource -->
<!-- $$$createSource[overload1]$$$createSourceconstQString&QObject* -->
<h3 class="fn" id="createSource"><a name="createSource"></a><code>[static] </code><span class="type"><a href="qgeopositioninfosource.html#QGeoPositionInfoSource">QGeoPositionInfoSource</a></span> * QGeoPositionInfoSource::<span class="name">createSource</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &<i> sourceName</i>, <span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i> parent</i>)</h3>
<p>Creates and returns a position source with the given <i>parent</i>, by loading the plugin named <i>sourceName</i>.</p>
<p>Returns 0 if the plugin cannot be found.</p>
<!-- @@@createSource -->
<!-- $$$error[overload1]$$$error -->
<h3 class="fn" id="error"><a name="error"></a><code>[pure virtual] </code><span class="type"><a href="qgeopositioninfosource.html#Error-enum">Error</a></span> QGeoPositionInfoSource::<span class="name">error</span>() const</h3>
<p>Returns the type of error that last occurred.</p>
<!-- @@@error -->
<!-- $$$error$$$errorQGeoPositionInfoSource::Error -->
<h3 class="fn" id="error-2"><a name="error-2"></a><code>[signal] </code><span class="type">void</span> QGeoPositionInfoSource::<span class="name">error</span>(<span class="type"><a href="qgeopositioninfosource.html#Error-enum">QGeoPositionInfoSource::Error</a></span><i> positioningError</i>)</h3>
<p>This signal is emitted after an error occurred. The <i>positioningError</i> parameter describes the type of error that occurred.</p>
<p>This signal is not emitted when an <a href="qgeopositioninfosource.html#updateTimeout">updateTimeout</a>() has occurred.</p>
<!-- @@@error -->
<!-- $$$lastKnownPosition[overload1]$$$lastKnownPositionbool -->
<h3 class="fn" id="lastKnownPosition"><a name="lastKnownPosition"></a><code>[pure virtual] </code><span class="type"><a href="qgeopositioninfo.html">QGeoPositionInfo</a></span> QGeoPositionInfoSource::<span class="name">lastKnownPosition</span>(<span class="type">bool</span><i> fromSatellitePositioningMethodsOnly</i> = false) const</h3>
<p>Returns an update containing the last known position, or a null update if none is available.</p>
<p>If <i>fromSatellitePositioningMethodsOnly</i> is true, this returns the last known position received from a satellite positioning method; if none is available, a null update is returned.</p>
<!-- @@@lastKnownPosition -->
<!-- $$$positionUpdated[overload1]$$$positionUpdatedconstQGeoPositionInfo& -->
<h3 class="fn" id="positionUpdated"><a name="positionUpdated"></a><code>[signal] </code><span class="type">void</span> QGeoPositionInfoSource::<span class="name">positionUpdated</span>(const <span class="type"><a href="qgeopositioninfo.html">QGeoPositionInfo</a></span> &<i> update</i>)</h3>
<p>If <a href="qgeopositioninfosource.html#startUpdates">startUpdates</a>() or <a href="qgeopositioninfosource.html#requestUpdate">requestUpdate</a>() is called, this signal is emitted when an update becomes available.</p>
<p>The <i>update</i> value holds the value of the new update.</p>
<!-- @@@positionUpdated -->
<!-- $$$preferredPositioningMethods[overload1]$$$preferredPositioningMethods -->
<h3 class="fn" id="preferredPositioningMethods"><a name="preferredPositioningMethods"></a><span class="type"><a href="qgeopositioninfosource.html#PositioningMethod-enum">PositioningMethods</a></span> QGeoPositionInfoSource::<span class="name">preferredPositioningMethods</span>() const</h3>
<p>Returns the positioning methods set by <a href="qgeopositioninfosource.html#setPreferredPositioningMethods">setPreferredPositioningMethods</a>().</p>
<p><b>See also </b><a href="qgeopositioninfosource.html#setPreferredPositioningMethods">setPreferredPositioningMethods</a>().</p>
<!-- @@@preferredPositioningMethods -->
<!-- $$$requestUpdate[overload1]$$$requestUpdateint -->
<h3 class="fn" id="requestUpdate"><a name="requestUpdate"></a><code>[pure virtual slot] </code><span class="type">void</span> QGeoPositionInfoSource::<span class="name">requestUpdate</span>(<span class="type">int</span><i> timeout</i> = 0)</h3>
<p>Attempts to get the current position and emit <a href="qgeopositioninfosource.html#positionUpdated">positionUpdated</a>() with this information. If the current position cannot be found within the given <i>timeout</i> (in milliseconds) or if <i>timeout</i> is less than the value returned by <a href="qgeopositioninfosource.html#minimumUpdateInterval-prop">minimumUpdateInterval</a>(), <a href="qgeopositioninfosource.html#updateTimeout">updateTimeout</a>() is emitted.</p>
<p>If the timeout is zero, the timeout defaults to a reasonable timeout period as appropriate for the source.</p>
<p>This does nothing if another update request is in progress. However it can be called even if <a href="qgeopositioninfosource.html#startUpdates">startUpdates</a>() has already been called and regular updates are in progress.</p>
<p>If the source uses multiple positioning methods, it tries to get the current position from the most accurate positioning method within the given timeout.</p>
<!-- @@@requestUpdate -->
<!-- $$$setPreferredPositioningMethods[overload1]$$$setPreferredPositioningMethodsPositioningMethods -->
<h3 class="fn" id="setPreferredPositioningMethods"><a name="setPreferredPositioningMethods"></a><code>[virtual] </code><span class="type">void</span> QGeoPositionInfoSource::<span class="name">setPreferredPositioningMethods</span>(<span class="type"><a href="qgeopositioninfosource.html#PositioningMethod-enum">PositioningMethods</a></span><i> methods</i>)</h3>
<p>Sets the preferred positioning methods for this source to <i>methods</i>.</p>
<p>If <i>methods</i> includes a method that is not supported by the source, the unsupported method will be ignored.</p>
<p>If <i>methods</i> does not include any methods supported by the source, the preferred methods will be set to the set of methods which the source supports.</p>
<p><b>Note:</b> When reimplementing this method, subclasses must call the base method implementation to ensure <a href="qgeopositioninfosource.html#preferredPositioningMethods">preferredPositioningMethods</a>() returns the correct value.</p>
<p><b>See also </b><a href="qgeopositioninfosource.html#preferredPositioningMethods">preferredPositioningMethods</a>() and <a href="qgeopositioninfosource.html#supportedPositioningMethods">supportedPositioningMethods</a>().</p>
<!-- @@@setPreferredPositioningMethods -->
<!-- $$$startUpdates[overload1]$$$startUpdates -->
<h3 class="fn" id="startUpdates"><a name="startUpdates"></a><code>[pure virtual slot] </code><span class="type">void</span> QGeoPositionInfoSource::<span class="name">startUpdates</span>()</h3>
<p>Starts emitting updates at regular intervals as specified by <a href="qgeopositioninfosource.html#updateInterval-prop">setUpdateInterval</a>().</p>
<p>If <a href="qgeopositioninfosource.html#updateInterval-prop">setUpdateInterval</a>() has not been called, the source will emit updates as soon as they become available.</p>
<p>An <a href="qgeopositioninfosource.html#updateTimeout">updateTimeout</a>() signal will be emitted if this <a href="qgeopositioninfosource.html">QGeoPositionInfoSource</a> subclass determines that it will not be able to provide regular updates. This could happen if a satellite fix is lost or if a hardware error is detected. Position updates will recommence if the data becomes available later on. The <a href="qgeopositioninfosource.html#updateTimeout">updateTimeout</a>() signal will not be emitted again until after the periodic updates resume.</p>
<p>On iOS, starting from version 8, Core Location framework requires additional entries in the application's Info.plist with keys NSLocationAlwaysUsageDescription or NSLocationWhenInUseUsageDescription and a string to be displayed in the authorization prompt. The key NSLocationWhenInUseUsageDescription is used when requesting permission to use location services while the app is in the foreground. The key NSLocationAlwaysUsageDescription is used when requesting permission to use location services whenever the app is running (both the foreground and the background). If both entries are defined, NSLocationWhenInUseUsageDescription has a priority in the foreground mode.</p>
<!-- @@@startUpdates -->
<!-- $$$stopUpdates[overload1]$$$stopUpdates -->
<h3 class="fn" id="stopUpdates"><a name="stopUpdates"></a><code>[pure virtual slot] </code><span class="type">void</span> QGeoPositionInfoSource::<span class="name">stopUpdates</span>()</h3>
<p>Stops emitting updates at regular intervals.</p>
<!-- @@@stopUpdates -->
<!-- $$$supportedPositioningMethods[overload1]$$$supportedPositioningMethods -->
<h3 class="fn" id="supportedPositioningMethods"><a name="supportedPositioningMethods"></a><code>[pure virtual] </code><span class="type"><a href="qgeopositioninfosource.html#PositioningMethod-enum">PositioningMethods</a></span> QGeoPositionInfoSource::<span class="name">supportedPositioningMethods</span>() const</h3>
<p>Returns the positioning methods available to this source.</p>
<p><b>See also </b><a href="qgeopositioninfosource.html#setPreferredPositioningMethods">setPreferredPositioningMethods</a>().</p>
<!-- @@@supportedPositioningMethods -->
<!-- $$$updateTimeout[overload1]$$$updateTimeout -->
<h3 class="fn" id="updateTimeout"><a name="updateTimeout"></a><code>[signal] </code><span class="type">void</span> QGeoPositionInfoSource::<span class="name">updateTimeout</span>()</h3>
<p>If <a href="qgeopositioninfosource.html#requestUpdate">requestUpdate</a>() was called, this signal will be emitted if the current position could not be retrieved within the specified timeout.</p>
<p>If <a href="qgeopositioninfosource.html#startUpdates">startUpdates</a>() has been called, this signal will be emitted if this <a href="qgeopositioninfosource.html">QGeoPositionInfoSource</a> subclass determines that it will not be able to provide further regular updates. This signal will not be emitted again until after the regular updates resume.</p>
<p>While the triggering of this signal may be considered an error condition, it does not imply the emission of the <code>error()</code> signal. Only the emission of <code>updateTimeout()</code> is required to indicate a timeout.</p>
<!-- @@@updateTimeout -->
</div>
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2015 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>
|