QPlaceContentRequest Class▲
-
Header: QPlaceContentRequest
-
qmake: QT += location
-
Group: QPlaceContentRequest is part of QtLocation-places, QtLocation-places-requests
Detailed Description▲
The QPlaceContentRequest class is used in conjunction with a QPlaceManager 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:
QPlaceContentRequest request;
request.setContentType(QPlaceContent::
ImageType);
request.setPlaceId(place.placeId());
request.setLimit(5
);
QPlaceContentReply *
contentReply =
manager-&
gt;getPlaceContent(request);
//..connect signals..//
...
...
void
contentHandler() {
if
(contentReply-&
gt;error() ==
QPlaceReply::
NoError) {
place.insertContent(contentReply-&
gt;request().contentType(),
contentReply-&
gt;content());
}
}
See Also▲
See also QPlaceContentReply
Member Function Documentation▲
QPlaceContentRequest::QPlaceContentRequest()▲
Constructs a new request object.
QPlaceContentRequest::QPlaceContentRequest(const QPlaceContentRequest &other)▲
Constructs a copy of other.
QPlaceContentRequest::~QPlaceContentRequest()▲
Destroys the request object
void QPlaceContentRequest::clear()▲
Clears the content request.
QVariant QPlaceContentRequest::contentContext() const▲
Returns backend specific additional content context associated with this place content request.
See Also▲
See also setContentContext()
QPlaceContent::Type QPlaceContentRequest::contentType() const▲
Returns the type of content to be requested, for example reviews or images
See Also▲
See also setContentType()
int QPlaceContentRequest::limit() const▲
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▲
See also setLimit()
QString QPlaceContentRequest::placeId() const▲
void QPlaceContentRequest::setContentContext(const QVariant &context)▲
Sets the content context to context.
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▲
See also contentContext()
void QPlaceContentRequest::setContentType(QPlaceContent::Type type)▲
void QPlaceContentRequest::setLimit(int limit)▲
void QPlaceContentRequest::setPlaceId(const QString &identifier)▲
QPlaceContentRequest &QPlaceContentRequest::operator=(const QPlaceContentRequest &other)▲
Assigns other to this content request and returns a reference to this content request.