Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QPlaceResult Class Reference

\inmodule QtLocation More...

#include <qplaceresult.h>

+ Inheritance diagram for QPlaceResult:
+ Collaboration diagram for QPlaceResult:

Public Member Functions

 QPlaceResult ()
 Constructs a new place result object.
 
virtual ~QPlaceResult ()
 Destructor.
 
qreal distance () const
 Returns the distance of the place to the search center.
 
void setDistance (qreal distance)
 Set the distance of the search result's place from a search center.
 
QPlace place () const
 Returns the place of the search result.
 
void setPlace (const QPlace &place)
 Sets the place that this result refers to.
 
bool isSponsored () const
 Returns true if the result is a sponsored result.
 
void setSponsored (bool sponsored)
 Sets whether the result is a sponsored result or not.
 
- Public Member Functions inherited from QPlaceSearchResult
 QPlaceSearchResult ()
 Constructs a new search result.
 
 QPlaceSearchResult (const QPlaceSearchResult &other)
 Constructs a copy of other.
 
virtual ~QPlaceSearchResult ()
 Destroys the search result.
 
QPlaceSearchResultoperator= (const QPlaceSearchResult &other)
 Assigns other to this search result and returns a reference to this search result.
 
bool operator== (const QPlaceSearchResult &other) const
 Returns true if other is equal to this search result, otherwise returns false.
 
bool operator!= (const QPlaceSearchResult &other) const
 Returns true if other not equal to this search result, otherwise returns false.
 
SearchResultType type () const
 Returns the result type.
 
QString title () const
 Returns the title of the search result.
 
void setTitle (const QString &title)
 Sets the title of the search result to title.
 
QPlaceIcon icon () const
 Returns an icon that can be used to represent the search result.
 
void setIcon (const QPlaceIcon &icon)
 Sets the icon of the search result to icon.
 

Additional Inherited Members

- Public Types inherited from QPlaceSearchResult
enum  SearchResultType { UnknownSearchResult = 0 , PlaceResult , ProposedSearchResult }
 Defines the type of search result. More...
 
- Protected Member Functions inherited from QPlaceSearchResult
 QPlaceSearchResult (QPlaceSearchResultPrivate *d)
 
- Protected Attributes inherited from QPlaceSearchResult
QSharedDataPointer< QPlaceSearchResultPrivated_ptr
 

Detailed Description

\inmodule QtLocation

Since
5.6

The QPlaceResult class represents a search result containing a place.

The PlaceResult 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 \l {http://en.wikipedia.org/wiki/Organic_search}{organic}.

The intended usage is that a QPlaceSearchResult can be converted into a QPlaceResult like so:

The implementation is handled in such a way that object slicing is not an issue.

See also
QPlaceSearchResult

Definition at line 14 of file qplaceresult.h.

Constructor & Destructor Documentation

◆ QPlaceResult()

QPlaceResult::QPlaceResult ( )

Constructs a new place result object.

Constructs a copy of other if possible, otherwise constructs a default place result.

Definition at line 46 of file qplaceresult.cpp.

◆ ~QPlaceResult()

QPlaceResult::~QPlaceResult ( )
virtual

Destructor.

Definition at line 54 of file qplaceresult.cpp.

Member Function Documentation

◆ distance()

qreal QPlaceResult::distance ( ) const

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.

Definition at line 73 of file qplaceresult.cpp.

References d.

Referenced by QDeclarativeSearchResultModel::data(), and setDistance().

+ Here is the caller graph for this function:

◆ isSponsored()

bool QPlaceResult::isSponsored ( ) const

Returns true if the result is a sponsored result.

See also
setSponsored()

Definition at line 111 of file qplaceresult.cpp.

References d.

Referenced by QDeclarativeSearchResultModel::data().

+ Here is the caller graph for this function:

◆ place()

QPlace QPlaceResult::place ( ) const

Returns the place of the search result.

Definition at line 91 of file qplaceresult.cpp.

References d.

Referenced by setPlace().

+ Here is the caller graph for this function:

◆ setDistance()

void QPlaceResult::setDistance ( qreal distance)

Set the distance of the search result's place from a search center.

Definition at line 82 of file qplaceresult.cpp.

References d, and distance().

+ Here is the call graph for this function:

◆ setPlace()

void QPlaceResult::setPlace ( const QPlace & place)

Sets the place that this result refers to.

Definition at line 100 of file qplaceresult.cpp.

References d, and place().

Referenced by QT_BEGIN_NAMESPACE::parsePlaceResult().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSponsored()

void QPlaceResult::setSponsored ( bool sponsored)

Sets whether the result is a sponsored result or not.

See also
isSponsored()

Definition at line 122 of file qplaceresult.cpp.

References d.


The documentation for this class was generated from the following files: