- class QPlaceSearchResult¶
The
QPlaceSearchResult
class is the base class for search results. More…Inherited by:
QPlaceResult
,QPlaceProposedSearchResult
Synopsis¶
Methods¶
def
__init__()
def
icon()
def
__ne__()
def
__eq__()
def
setIcon()
def
setTitle()
def
title()
def
type()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description¶
Warning
This section contains snippets that were automatically translated from C++ to Python and may contain errors.
A list of search results can be retrieved from the
QPlaceSearchReply
after it has successfully completed the request. Common to all search results are thetitle
andicon
, 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: placeResult = result print(placeResult.place().name()) print(placeResult.place().location().coordinate()) print(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.See also
- class SearchResultType¶
Defines the type of search result
Constant
Description
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.
- __init__()¶
Constructs a new search result.
- __init__(other)
- Parameters:
other –
QPlaceSearchResult
Constructs a copy of
other
- icon()¶
- Return type:
Returns an icon that can be used to represent the search result.
See also
- __ne__(other)¶
- Parameters:
other –
QPlaceSearchResult
- Return type:
bool
Returns true if
other
not equal to this search result, otherwise returns false.- __eq__(other)¶
- Parameters:
other –
QPlaceSearchResult
- Return type:
bool
Returns true if
other
is equal to this search result, otherwise returns false.- setIcon(icon)¶
- Parameters:
icon –
QPlaceIcon
Sets the icon of the search result to
icon
.See also
- setTitle(title)¶
- Parameters:
title – str
Sets the title of the search result to
title
.See also
- title()¶
- Return type:
str
Returns the title of the search result. This string can be used to display the search result to the user.
See also
- type()¶
- Return type:
Returns the result type.