内容表

上一话题

QPlaceContentReply

下一话题

QPlaceDetailsReply

QPlaceContentRequest

QPlaceContentRequest class represents the parameters of a content request. 更多

Inheritance diagram of PySide2.QtLocation.QPlaceContentRequest

概要

函数

详细描述

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->getPlaceContent(request);
    //..connect signals..//
...
...
void contentHandler() {
    if (contentReply->error() == QPlaceReply::NoError)  {
        place.insertContent(contentReply->request().contentType(),
                            contentReply->content());
    }
}
											
class QPlaceContentRequest

QPlaceContentRequest(other)

param other

QPlaceContentRequest

Constructs a new request object.

构造副本为 other .

PySide2.QtLocation.QPlaceContentRequest. clear ( )

Clears the content request.

PySide2.QtLocation.QPlaceContentRequest. contentContext ( )
返回类型

object

Returns backend specific additional content context associated with this place content request.

PySide2.QtLocation.QPlaceContentRequest. contentType ( )
返回类型

Type

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

另请参阅

setContentType()

PySide2.QtLocation.QPlaceContentRequest. limit ( )
返回类型

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.

另请参阅

setLimit()

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

other QPlaceContentRequest

返回类型

bool

返回 true 若 other is not equal to this content request, otherwise returns false.

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

other QPlaceContentRequest

返回类型

bool

返回 true 若 other is equal to this content request, otherwise returns false.

PySide2.QtLocation.QPlaceContentRequest. placeId ( )
返回类型

unicode

Returns the identifier of the place content is to be fetched for.

另请参阅

setPlaceId()

PySide2.QtLocation.QPlaceContentRequest. setContentContext ( context )
参数

context – object

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.

另请参阅

contentContext()

PySide2.QtLocation.QPlaceContentRequest. setContentType ( type )
参数

type Type

设置 type of content to be requested.

另请参阅

contentType()

PySide2.QtLocation.QPlaceContentRequest. setLimit ( limit )
参数

limit int

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

另请参阅

limit()

PySide2.QtLocation.QPlaceContentRequest. setPlaceId ( identifier )
参数

identifier – unicode

Sets the identifier of the place to fetch content for to identifier .

另请参阅

placeId()