QPlaceContentRequest Class

The QPlaceContentRequest class represents the parameters of a content request. More...

Header: #include <QPlaceContentRequest>
qmake: QT += location
Since: Qt Location 5.0

Public Functions

QPlaceContentRequest()
QPlaceContentRequest(const QPlaceContentRequest & other)
~QPlaceContentRequest()
void clear()
QPlaceContent::Type contentType() const
int limit() const
int offset() const
void setContentType(QPlaceContent::Type type)
void setLimit(int limit)
void setOffset(int offset)
bool operator!=(const QPlaceContentRequest & other) const
QPlaceContentRequest & operator=(const QPlaceContentRequest & other)
bool operator==(const QPlaceContentRequest & other) const

Detailed Description

The QPlaceContentRequest class represents the parameters of a content request.

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.setOffset(9);
request.setLimit(5);

QPlaceContentReply *contentReply = manager->getPlaceContent(place.placeId(), request);
//..connect signals..//
    ...
    ...
void contentHandler() {
    if (contentReply->error() == QPlaceReply::NoError)  {
        place.insertContent(contentReply->request().contentType(),
                            contentReply->content());
    }
}

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.

QPlaceContent::Type QPlaceContentRequest::contentType() const

Returns the type of content to be requested, for example reviews or images

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 setLimit().

int QPlaceContentRequest::offset() const

Returns the offset index of the first item that is to be retrieved.

The default offset is 0.

See also setOffset().

void QPlaceContentRequest::setContentType(QPlaceContent::Type type)

Sets the type of content to be requested.

See also contentType().

void QPlaceContentRequest::setLimit(int limit)

Set the maximum number of content items to retrieve to limit.

See also limit().

void QPlaceContentRequest::setOffset(int offset)

Sets the starting index of the first item to be retrieved to offset.

See also offset().

bool QPlaceContentRequest::operator!=(const QPlaceContentRequest & other) const

Returns true if other is not equal to this content request, otherwise returns false.

QPlaceContentRequest & QPlaceContentRequest::operator=(const QPlaceContentRequest & other)

Assigns other to this content request and returns a reference to this content request.

bool QPlaceContentRequest::operator==(const QPlaceContentRequest & other) const

Returns true if other is equal to this content request, otherwise returns false.