PySide6.QtLocation.QPlaceContentRequest¶
- class QPlaceContentRequest¶
The
QPlaceContentRequest
class represents the parameters of a content request. More…Synopsis¶
Methods¶
def
__init__()
def
clear()
def
contentContext()
def
contentType()
def
limit()
def
__ne__()
def
__eq__()
def
placeId()
def
setContentType()
def
setLimit()
def
setPlaceId()
def
swap()
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.
The
QPlaceContentRequest
class is used in conjunction with aQPlaceManager
to retrieve rich content like images and reviews in a paginated fashion. The following code would request a set of 5 images from the 10th index:request = QPlaceContentRequest() request.setContentType(QPlaceContent.ImageType) request.setPlaceId(place.placeId()) request.setLimit(5) contentReply = manager.getPlaceContent(request) #..connect signals..// ... ... def contentHandler(): if contentReply.error() == QPlaceReply.NoError: place.insertContent(contentReply.request().contentType(), contentReply.content())
See also
- __init__()¶
Constructs a new request object.
- __init__(other)
- Parameters:
other –
QPlaceContentRequest
Constructs a copy of
other
.- clear()¶
Clears the content request.
- contentContext()¶
- Return type:
object
Returns backend specific additional content context associated with this place content request.
See also
Returns the type of content to be requested, for example reviews or images
See also
- limit()¶
- Return type:
int
Returns the maximum number of content items to retrieve.
A negative value for limit means that it is undefined. It is left up to the backend provider to choose an appropriate number of items to return.
The default limit is -1.
See also
- __ne__(rhs)¶
- Parameters:
rhs –
QPlaceContentRequest
- Return type:
bool
Returns true if
lhs
is not equal torhs
, otherwise returns false.- __eq__(rhs)¶
- Parameters:
rhs –
QPlaceContentRequest
- Return type:
bool
Returns true if
lhs
is equal torhs
, otherwise returns false.- placeId()¶
- Return type:
str
Returns the identifier of the place content is to be fetched for.
See also
- setContentContext(context)¶
- Parameters:
context – object
Sets the content context to
context
.Note
This method is intended to be used by geo service plugins when returning place content results.
The content context is used by backends to store additional content context related to the content request. Other relevant fields should also be filled in. For example, if the content request is for image content the content type should also be set with
setContentType()
. The content context allows additional context to be kept which is not directly accessible via the Qt Location API.The content context can be of any type storable in a QVariant. The value of the content context is not intended to be used directly by applications.
See also
Sets the
type
of content to be requested.See also
- setLimit(limit)¶
- Parameters:
limit – int
Set the maximum number of content items to retrieve to
limit
.See also
- setPlaceId(identifier)¶
- Parameters:
identifier – str
Sets the identifier of the place to fetch content for to
identifier
.See also
- swap(other)¶
- Parameters:
other –
QPlaceContentRequest