内容表

上一话题

QPlaceSearchRequest

下一话题

QPlaceSearchSuggestionReply

QPlaceSearchResult

QPlaceSearchResult class is the base class for search results. 更多

Inheritance diagram of PySide2.QtLocation.QPlaceSearchResult

继承者: QPlaceProposedSearchResult , QPlaceResult

概要

函数

详细描述

A list of search results can be retrieved from the QPlaceSearchReply after it has successfully completed the request. Common to all search results are the title and icon , which can be used to present the search result to the user.

The intended usage is that depending on the type , the search result can be converted to a more detailed subclass like so:

if (result.type() == QPlaceSearchResult::PlaceResult) {
    QPlaceResult placeResult = result;
    qDebug() << placeResult.place().name();
    qDebug() << placeResult.place().location().coordinate();
    qDebug() << placeResult.distance();
}
											

The implementation is handled in such a way that object slicing is not an issue. It is not expected that client applications or backend plugins instantiate a QPlaceSearchResult directly, but rather client applications simply convert to search result subclasses and backend plugins only instantiate subclasses.

另请参阅

QPlaceResult

class QPlaceSearchResult

QPlaceSearchResult(other)

param other

QPlaceSearchResult

Constructs a new search result.

构造副本为 other

PySide2.QtLocation.QPlaceSearchResult. SearchResultType

Defines the type of search result

常量

描述

QPlaceSearchResult.UnknownSearchResult

The contents of the search result are unknown.

QPlaceSearchResult.PlaceResult

The search result contains a place.

QPlaceSearchResult.ProposedSearchResult

The search result contains a proposed search which may be relevant.

PySide2.QtLocation.QPlaceSearchResult. icon ( )
返回类型

QPlaceIcon

Returns an icon that can be used to represent the search result.

另请参阅

setIcon()

PySide2.QtLocation.QPlaceSearchResult. __ne__ ( other )
参数

other QPlaceSearchResult

返回类型

bool

返回 true 若 other not equal to this search result, otherwise returns false.

PySide2.QtLocation.QPlaceSearchResult. __eq__ ( other )
参数

other QPlaceSearchResult

返回类型

bool

返回 true 若 other is equal to this search result, otherwise returns false.

PySide2.QtLocation.QPlaceSearchResult. setIcon ( icon )
参数

icon QPlaceIcon

Sets the icon of the search result to icon .

另请参阅

icon()

PySide2.QtLocation.QPlaceSearchResult. setTitle ( title )
参数

title – unicode

Sets the title of the search result to title .

另请参阅

title()

PySide2.QtLocation.QPlaceSearchResult. title ( )
返回类型

unicode

Returns the title of the search result. This string can be used to display the search result to the user.

另请参阅

setTitle()

PySide2.QtLocation.QPlaceSearchResult. type ( )
返回类型

SearchResultType

Returns the result type.