<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qgeocodingmanager.cpp --> <title>QGeoCodingManager Class | Qt Location 5.11</title> <link rel="stylesheet" type="text/css" href="style/offline-simple.css" /> <script type="text/javascript"> document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css"); // loading style sheet breaks anchors that were jumped to before // so force jumping to anchor again setTimeout(function() { var anchor = location.hash; // need to jump to different anchor first (e.g. none) location.hash = "#"; setTimeout(function() { location.hash = anchor; }, 0); }, 0); </script> </head> <body> <div class="header" id="qtdocheader"> <div class="main"> <div class="main-rounded"> <div class="navigationbar"> <table><tr> <td ><a href="../qtdoc/index.html">Qt 5.11</a></td><td ><a href="qtlocation-index.html">Qt Location</a></td><td ><a href="qtlocation-module.html">C++ Classes</a></td><td >QGeoCodingManager</td></tr></table><table class="buildversion"><tr> <td id="buildversion" width="100%" align="right">Qt 5.11.2 Reference Documentation</td> </tr></table> </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-functions">Public Functions</a></li> <li class="level1"><a href="#signals">Signals</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">QGeoCodingManager Class</h1> <!-- $$$QGeoCodingManager-brief --> <p>The <a href="qgeocodingmanager.html">QGeoCodingManager</a> class provides support for geocoding operations. <a href="#details">More...</a></p> <!-- @@@QGeoCodingManager --> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <QGeoCodingManager></span> </td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += location</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign"> Qt 5.6</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="../qtcore/qobject.html">QObject</a></td></tr></table></div><ul> <li><a href="qgeocodingmanager-members.html">List of all members, including inherited members</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"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qgeocodingmanager.html#dtor.QGeoCodingManager">~QGeoCodingManager</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QGeoCodeReply *</td><td class="memItemRight bottomAlign"><b><a href="qgeocodingmanager.html#geocode">geocode</a></b>(const QGeoAddress &<i>address</i>, const QGeoShape &<i>bounds</i> = QGeoShape())</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QGeoCodeReply *</td><td class="memItemRight bottomAlign"><b><a href="qgeocodingmanager.html#geocode-1">geocode</a></b>(const QString &<i>address</i>, int <i>limit</i> = -1, int <i>offset</i> = 0, const QGeoShape &<i>bounds</i> = QGeoShape())</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QLocale </td><td class="memItemRight bottomAlign"><b><a href="qgeocodingmanager.html#locale">locale</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qgeocodingmanager.html#managerName">managerName</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qgeocodingmanager.html#managerVersion">managerVersion</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QGeoCodeReply *</td><td class="memItemRight bottomAlign"><b><a href="qgeocodingmanager.html#reverseGeocode">reverseGeocode</a></b>(const QGeoCoordinate &<i>coordinate</i>, const QGeoShape &<i>bounds</i> = QGeoShape())</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgeocodingmanager.html#setLocale">setLocale</a></b>(const QLocale &<i>locale</i>)</td></tr> </table></div> <ul> <li class="fn">34 public functions inherited from <a href="../qtcore/qobject.html#public-functions">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="qgeocodingmanager.html#error">error</a></b>(QGeoCodeReply *<i>reply</i>, QGeoCodeReply::Error <i>error</i>, QString <i>errorString</i> = QString())</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgeocodingmanager.html#finished">finished</a></b>(QGeoCodeReply *<i>reply</i>)</td></tr> </table></div> <ul> <li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li> </ul> <h3>Additional Inherited Members</h3> <ul> <li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</a></li> <li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li> <li class="fn">1 public variable inherited from <a href="../qtcore/qobject.html#public-variables">QObject</a></li> <li class="fn">10 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">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> <!-- $$$QGeoCodingManager-description --> <div class="descr"> <h2 id="details">Detailed Description</h2> <p>The <a href="qgeocodingmanager.html">QGeoCodingManager</a> class provides support for geocoding operations.</p> <p>The <a href="qgeocodingmanager.html#geocode">geocode</a>() and <a href="qgeocodingmanager.html#reverseGeocode">reverseGeocode</a>() functions return <a href="qgeocodereply.html">QGeoCodeReply</a> objects, which manage these operations and report on the result of the operations and any errors which may have occurred.</p> <p>The <a href="qgeocodingmanager.html#geocode">geocode</a>() and <a href="qgeocodingmanager.html#reverseGeocode">reverseGeocode</a>() functions can be used to convert <a href="../qtpositioning/qgeoaddress.html">QGeoAddress</a> instances to <a href="../qtpositioning/qgeocoordinate.html">QGeoCoordinate</a> instances and vice-versa.</p> <p>The <a href="qgeocodingmanager.html#geocode">geocode</a>() function is also overloaded to allow a user to perform a free text geocoding operation, if the string provided can be interpreted as an address it can be geocoded to coordinate information.</p> <p>Instances of <a href="qgeocodingmanager.html">QGeoCodingManager</a> can be accessed with <a href="qgeoserviceprovider.html#geocodingManager">QGeoServiceProvider::geocodingManager</a>().</p> </div> <!-- @@@QGeoCodingManager --> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$~QGeoCodingManager[overload1]$$$~QGeoCodingManager --> <h3 class="fn" id="dtor.QGeoCodingManager"><a name="dtor.QGeoCodingManager"></a><code>[virtual] </code>QGeoCodingManager::<span class="name">~QGeoCodingManager</span>()</h3> <p>Destroys this manager.</p> <!-- @@@~QGeoCodingManager --> <!-- $$$error[overload1]$$$errorQGeoCodeReply*QGeoCodeReply::ErrorQString --> <h3 class="fn" id="error"><a name="error"></a><code>[signal] </code><span class="type">void</span> QGeoCodingManager::<span class="name">error</span>(<span class="type"><a href="qgeocodereply.html">QGeoCodeReply</a></span> *<i>reply</i>, <span class="type"><a href="qgeocodereply.html#Error-enum">QGeoCodeReply::Error</a></span> <i>error</i>, <span class="type"><a href="../qtcore/qstring.html">QString</a></span> <i>errorString</i> = QString())</h3> <p>This signal is emitted when an error has been detected in the processing of <i>reply</i>. The <a href="qgeocodingmanager.html#finished">QGeoCodingManager::finished</a>() signal will probably follow.</p> <p>The error will be described by the error code <i>error</i>. If <i>errorString</i> is not empty it will contain a textual description of the error.</p> <p>This signal and <a href="qgeocodereply.html#error">QGeoCodeReply::error</a>() will be emitted at the same time.</p> <p><b>Note: </b>Do not delete the <i>reply</i> object in the slot connected to this signal. Use <a href="../qtcore/qobject.html#deleteLater">deleteLater</a>() instead.</p><!-- @@@error --> <!-- $$$finished[overload1]$$$finishedQGeoCodeReply* --> <h3 class="fn" id="finished"><a name="finished"></a><code>[signal] </code><span class="type">void</span> QGeoCodingManager::<span class="name">finished</span>(<span class="type"><a href="qgeocodereply.html">QGeoCodeReply</a></span> *<i>reply</i>)</h3> <p>This signal is emitted when <i>reply</i> has finished processing.</p> <p>If reply::error() equals <a href="qgeocodereply.html#Error-enum">QGeoCodeReply::NoError</a> then the processing finished successfully.</p> <p>This signal and <a href="qgeocodereply.html#finished">QGeoCodeReply::finished</a>() will be emitted at the same time.</p> <p><b>Note: </b>Do not delete the <i>reply</i> object in the slot connected to this signal. Use <a href="../qtcore/qobject.html#deleteLater">deleteLater</a>() instead.</p><!-- @@@finished --> <!-- $$$geocode[overload1]$$$geocodeconstQGeoAddress&constQGeoShape& --> <h3 class="fn" id="geocode"><a name="geocode"></a><span class="type"><a href="qgeocodereply.html">QGeoCodeReply</a></span> *QGeoCodingManager::<span class="name">geocode</span>(const <span class="type"><a href="../qtpositioning/qgeoaddress.html">QGeoAddress</a></span> &<i>address</i>, const <span class="type"><a href="../qtpositioning/qgeoshape.html">QGeoShape</a></span> &<i>bounds</i> = QGeoShape())</h3> <p>Begins the geocoding of <i>address</i>. Geocoding is the process of finding a coordinate that corresponds to a given address.</p> <p>A <a href="qgeocodereply.html">QGeoCodeReply</a> object will be returned, which can be used to manage the geocoding operation and to return the results of the operation.</p> <p>This manager and the returned <a href="qgeocodereply.html">QGeoCodeReply</a> object will emit signals indicating if the operation completes or if errors occur.</p> <p>If supportsGeocoding() returns false an <a href="qgeocodereply.html#Error-enum">QGeoCodeReply::UnsupportedOptionError</a> will occur.</p> <p>Once the operation has completed, <a href="qgeocodereply.html#locations">QGeoCodeReply::locations</a>() can be used to retrieve the results, which will consist of a list of <a href="../qtpositioning/qgeolocation.html">QGeoLocation</a> objects. These objects represent a combination of coordinate and address data.</p> <p>The address data returned in the results may be different from <i>address</i>. This will usually occur if the geocoding service backend uses a different canonical form of addresses or if <i>address</i> was only partially filled out.</p> <p>If <i>bounds</i> is non-null and is a valid <a href="../qtpositioning/qgeoshape.html">QGeoShape</a> it will be used to limit the results to those that are contained within <i>bounds</i>. This is particularly useful if <i>address</i> is only partially filled out, as the service will attempt to geocode all matches for the specified data.</p> <p>The user is responsible for deleting the returned reply object, although this can be done in the slot connected to <a href="qgeocodingmanager.html#finished">QGeoCodingManager::finished</a>(), <a href="qgeocodingmanager.html#error">QGeoCodingManager::error</a>(), <a href="qgeocodereply.html#finished">QGeoCodeReply::finished</a>() or <a href="qgeocodereply.html#error">QGeoCodeReply::error</a>() with <a href="../qtcore/qobject.html#deleteLater">deleteLater</a>().</p> <!-- @@@geocode --> <!-- $$$geocode$$$geocodeconstQString&intintconstQGeoShape& --> <h3 class="fn" id="geocode-1"><a name="geocode-1"></a><span class="type"><a href="qgeocodereply.html">QGeoCodeReply</a></span> *QGeoCodingManager::<span class="name">geocode</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &<i>address</i>, <span class="type">int</span> <i>limit</i> = -1, <span class="type">int</span> <i>offset</i> = 0, const <span class="type"><a href="../qtpositioning/qgeoshape.html">QGeoShape</a></span> &<i>bounds</i> = QGeoShape())</h3> <p>Begins geocoding for a location matching <i>address</i>.</p> <p>A <a href="qgeocodereply.html">QGeoCodeReply</a> object will be returned, which can be used to manage the geocoding operation and to return the results of the operation.</p> <p>This manager and the returned <a href="qgeocodereply.html">QGeoCodeReply</a> object will emit signals indicating if the operation completes or if errors occur.</p> <p>Once the operation has completed, <a href="qgeocodereply.html#locations">QGeoCodeReply::locations</a>() can be used to retrieve the results, which will consist of a list of <a href="../qtpositioning/qgeolocation.html">QGeoLocation</a> objects. These objects represent a combination of coordinate and address data.</p> <p>If <i>limit</i> is -1 the entire result set will be returned, otherwise at most <i>limit</i> results will be returned.</p> <p>The <i>offset</i> parameter is used to ask the geocoding service to not return the first <i>offset</i> results.</p> <p>The <i>limit</i> and <i>offset</i> results are used together to implement paging.</p> <p>If <i>bounds</i> is non-null and a valid <a href="../qtpositioning/qgeoshape.html">QGeoShape</a> it will be used to limit the results to those that are contained within <i>bounds</i>.</p> <p>The user is responsible for deleting the returned reply object, although this can be done in the slot connected to <a href="qgeocodingmanager.html#finished">QGeoCodingManager::finished</a>(), <a href="qgeocodingmanager.html#error">QGeoCodingManager::error</a>(), <a href="qgeocodereply.html#finished">QGeoCodeReply::finished</a>() or <a href="qgeocodereply.html#error">QGeoCodeReply::error</a>() with <a href="../qtcore/qobject.html#deleteLater">deleteLater</a>().</p> <!-- @@@geocode --> <!-- $$$locale[overload1]$$$locale --> <h3 class="fn" id="locale"><a name="locale"></a><span class="type"><a href="../qtcore/qlocale.html">QLocale</a></span> QGeoCodingManager::<span class="name">locale</span>() const</h3> <p>Returns the locale used to hint to this geocoding manager about what language to use for the results.</p> <p><b>See also </b><a href="qgeocodingmanager.html#setLocale">setLocale</a>().</p> <!-- @@@locale --> <!-- $$$managerName[overload1]$$$managerName --> <h3 class="fn" id="managerName"><a name="managerName"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QGeoCodingManager::<span class="name">managerName</span>() const</h3> <p>Returns the name of the engine which implements the behaviour of this geocoding manager.</p> <p>The combination of managerName() and <a href="qgeocodingmanager.html#managerVersion">managerVersion</a>() should be unique amongst the plugin implementations.</p> <!-- @@@managerName --> <!-- $$$managerVersion[overload1]$$$managerVersion --> <h3 class="fn" id="managerVersion"><a name="managerVersion"></a><span class="type">int</span> QGeoCodingManager::<span class="name">managerVersion</span>() const</h3> <p>Returns the version of the engine which implements the behaviour of this geocoding manager.</p> <p>The combination of <a href="qgeocodingmanager.html#managerName">managerName</a>() and managerVersion() should be unique amongst the plugin implementations.</p> <!-- @@@managerVersion --> <!-- $$$reverseGeocode[overload1]$$$reverseGeocodeconstQGeoCoordinate&constQGeoShape& --> <h3 class="fn" id="reverseGeocode"><a name="reverseGeocode"></a><span class="type"><a href="qgeocodereply.html">QGeoCodeReply</a></span> *QGeoCodingManager::<span class="name">reverseGeocode</span>(const <span class="type"><a href="../qtpositioning/qgeocoordinate.html">QGeoCoordinate</a></span> &<i>coordinate</i>, const <span class="type"><a href="../qtpositioning/qgeoshape.html">QGeoShape</a></span> &<i>bounds</i> = QGeoShape())</h3> <p>Begins the reverse geocoding of <i>coordinate</i>. Reverse geocoding is the process of finding an address that corresponds to a given coordinate.</p> <p>A <a href="qgeocodereply.html">QGeoCodeReply</a> object will be returned, which can be used to manage the reverse geocoding operation and to return the results of the operation.</p> <p>This manager and the returned <a href="qgeocodereply.html">QGeoCodeReply</a> object will emit signals indicating if the operation completes or if errors occur.</p> <p>If supportsReverseGeocoding() returns false an <a href="qgeocodereply.html#Error-enum">QGeoCodeReply::UnsupportedOptionError</a> will occur.</p> <p>At that point <a href="qgeocodereply.html#locations">QGeoCodeReply::locations</a>() can be used to retrieve the results, which will consist of a list of <a href="../qtpositioning/qgeolocation.html">QGeoLocation</a> objects. These objects represent a combination of coordinate and address data.</p> <p>The coordinate data returned in the results may be different from <i>coordinate</i>. This will usually occur if the reverse geocoding service backend shifts the coordinates to be closer to the matching addresses, or if the backend returns results at multiple levels of detail.</p> <p>If multiple results are returned by the reverse geocoding service backend they will be provided in order of specificity. This normally occurs if the backend is configured to reverse geocode across multiple levels of detail. As an example, some services will return address and coordinate pairs for the street address, the city, the state and the country.</p> <p>If <i>bounds</i> is non-null and a valid <a href="../qtpositioning/qgeorectangle.html">QGeoRectangle</a> it will be used to limit the results to those that are contained within <i>bounds</i>.</p> <p>The user is responsible for deleting the returned reply object, although this can be done in the slot connected to <a href="qgeocodingmanager.html#finished">QGeoCodingManager::finished</a>(), <a href="qgeocodingmanager.html#error">QGeoCodingManager::error</a>(), <a href="qgeocodereply.html#finished">QGeoCodeReply::finished</a>() or <a href="qgeocodereply.html#error">QGeoCodeReply::error</a>() with <a href="../qtcore/qobject.html#deleteLater">deleteLater</a>().</p> <!-- @@@reverseGeocode --> <!-- $$$setLocale[overload1]$$$setLocaleconstQLocale& --> <h3 class="fn" id="setLocale"><a name="setLocale"></a><span class="type">void</span> QGeoCodingManager::<span class="name">setLocale</span>(const <span class="type"><a href="../qtcore/qlocale.html">QLocale</a></span> &<i>locale</i>)</h3> <p>Sets the locale to be used by this manager to <i>locale</i>.</p> <p>If this geocoding manager supports returning the results in different languages, they will be returned in the language of <i>locale</i>.</p> <p>The locale used defaults to the system locale if this is not set.</p> <p><b>See also </b><a href="qgeocodingmanager.html#locale">locale</a>().</p> <!-- @@@setLocale --> </div> </div> </div> </div> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2018 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>