<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qplaceresult.cpp --> <title>QPlaceResult 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 >QPlaceResult</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="#details">Detailed Description</a></li> </ul> </div> <div class="sidebar-content" id="sidebar-content"></div></div> <h1 class="title">QPlaceResult Class</h1> <!-- $$$QPlaceResult-brief --> <p>The <a href="qplaceresult.html">QPlaceResult</a> class represents a search result containing a place. <a href="#details">More...</a></p> <!-- @@@QPlaceResult --> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <QPlaceResult></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="qplacesearchresult.html">QPlaceSearchResult</a></td></tr></table></div><ul> <li><a href="qplaceresult-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"> </td><td class="memItemRight bottomAlign"><b><a href="qplaceresult.html#QPlaceResult">QPlaceResult</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qplaceresult.html#QPlaceResult-1">QPlaceResult</a></b>(const QPlaceSearchResult &<i>other</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qplaceresult.html#dtor.QPlaceResult">~QPlaceResult</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qplaceresult.html#distance">distance</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qplaceresult.html#isSponsored">isSponsored</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QPlace </td><td class="memItemRight bottomAlign"><b><a href="qplaceresult.html#place">place</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplaceresult.html#setDistance">setDistance</a></b>(qreal <i>distance</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplaceresult.html#setPlace">setPlace</a></b>(const QPlace &<i>place</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplaceresult.html#setSponsored">setSponsored</a></b>(bool <i>sponsored</i>)</td></tr> </table></div> <ul> <li class="fn">8 public functions inherited from <a href="qplacesearchresult.html#public-functions">QPlaceSearchResult</a></li> </ul> <a name="details"></a> <!-- $$$QPlaceResult-description --> <div class="descr"> <h2 id="details">Detailed Description</h2> <p>The <a href="qplaceresult.html">QPlaceResult</a> class represents a search result containing a place.</p> <p>The <a href="qplacesearchresult.html#SearchResultType-enum">PlaceResult</a> holds the distance to the place from the center of the search request, an instance of the place and an indication of whether the result is sponsored or <a href="http://en.wikipedia.org/wiki/Organic_search">organic</a>.</p> <p>The intended usage is that a <a href="qplacesearchresult.html">QPlaceSearchResult</a> can be converted into a <a href="qplaceresult.html">QPlaceResult</a> like so:</p> <pre class="cpp"> <span class="keyword">if</span> (result<span class="operator">.</span>type() <span class="operator">=</span><span class="operator">=</span> <span class="type"><a href="qplacesearchresult.html#QPlaceSearchResult">QPlaceSearchResult</a></span><span class="operator">::</span>PlaceResult) { <span class="type"><a href="qplaceresult.html#QPlaceResult">QPlaceResult</a></span> placeResult <span class="operator">=</span> result; <a href="../qtcore/qtglobal.html#qDebug">qDebug</a>() <span class="operator"><</span><span class="operator"><</span> placeResult<span class="operator">.</span>place()<span class="operator">.</span>name(); <a href="../qtcore/qtglobal.html#qDebug">qDebug</a>() <span class="operator"><</span><span class="operator"><</span> placeResult<span class="operator">.</span>place()<span class="operator">.</span>location()<span class="operator">.</span>coordinate(); <a href="../qtcore/qtglobal.html#qDebug">qDebug</a>() <span class="operator"><</span><span class="operator"><</span> placeResult<span class="operator">.</span>distance(); } </pre> <p>The implementation is handled in such a way that object slicing is not an issue.</p> </div> <p><b>See also </b><a href="qplacesearchresult.html">QPlaceSearchResult</a>.</p> <!-- @@@QPlaceResult --> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QPlaceResult[overload1]$$$QPlaceResult --> <h3 class="fn" id="QPlaceResult"><a name="QPlaceResult"></a>QPlaceResult::<span class="name">QPlaceResult</span>()</h3> <p>Constructs a new place result object.</p> <!-- @@@QPlaceResult --> <!-- $$$QPlaceResult$$$QPlaceResultconstQPlaceSearchResult& --> <h3 class="fn" id="QPlaceResult-1"><a name="QPlaceResult-1"></a>QPlaceResult::<span class="name">QPlaceResult</span>(const <span class="type"><a href="qplacesearchresult.html#QPlaceSearchResult">QPlaceSearchResult</a></span> &<i>other</i>)</h3> <p>Constructs a copy of <i>other</i> if possible, otherwise constructs a default place result.</p> <!-- @@@QPlaceResult --> <!-- $$$~QPlaceResult[overload1]$$$~QPlaceResult --> <h3 class="fn" id="dtor.QPlaceResult"><a name="dtor.QPlaceResult"></a><code>[virtual] </code>QPlaceResult::<span class="name">~QPlaceResult</span>()</h3> <p>Destructor.</p> <!-- @@@~QPlaceResult --> <!-- $$$distance[overload1]$$$distance --> <h3 class="fn" id="distance"><a name="distance"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QPlaceResult::<span class="name">distance</span>() const</h3> <p>Returns the distance of the place to the search center. This field is only relevant provided the search request contained a search area with a search center. Otherwise, the distance is NaN indicating an undefined distance. The default value for distance is NaN.</p> <p><b>See also </b><a href="qplaceresult.html#setDistance">setDistance</a>().</p> <!-- @@@distance --> <!-- $$$isSponsored[overload1]$$$isSponsored --> <h3 class="fn" id="isSponsored"><a name="isSponsored"></a><span class="type">bool</span> QPlaceResult::<span class="name">isSponsored</span>() const</h3> <p>Returns true if the result is a sponsored result.</p> <p><b>See also </b><a href="qplaceresult.html#setSponsored">setSponsored</a>().</p> <!-- @@@isSponsored --> <!-- $$$place[overload1]$$$place --> <h3 class="fn" id="place"><a name="place"></a><span class="type"><a href="qplace.html">QPlace</a></span> QPlaceResult::<span class="name">place</span>() const</h3> <p>Returns the place of the search result.</p> <p><b>See also </b><a href="qplaceresult.html#setPlace">setPlace</a>().</p> <!-- @@@place --> <!-- $$$setDistance[overload1]$$$setDistanceqreal --> <h3 class="fn" id="setDistance"><a name="setDistance"></a><span class="type">void</span> QPlaceResult::<span class="name">setDistance</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>distance</i>)</h3> <p>Set the <i>distance</i> of the search result's place from a search center.</p> <p><b>See also </b><a href="qplaceresult.html#distance">distance</a>().</p> <!-- @@@setDistance --> <!-- $$$setPlace[overload1]$$$setPlaceconstQPlace& --> <h3 class="fn" id="setPlace"><a name="setPlace"></a><span class="type">void</span> QPlaceResult::<span class="name">setPlace</span>(const <span class="type"><a href="qplace.html">QPlace</a></span> &<i>place</i>)</h3> <p>Sets the <i>place</i> that this result refers to.</p> <p><b>See also </b><a href="qplaceresult.html#place">place</a>().</p> <!-- @@@setPlace --> <!-- $$$setSponsored[overload1]$$$setSponsoredbool --> <h3 class="fn" id="setSponsored"><a name="setSponsored"></a><span class="type">void</span> QPlaceResult::<span class="name">setSponsored</span>(<span class="type">bool</span> <i>sponsored</i>)</h3> <p>Sets whether the result is a <i>sponsored</i> result or not.</p> <p><b>See also </b><a href="qplaceresult.html#isSponsored">isSponsored</a>().</p> <!-- @@@setSponsored --> </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>