QPlaceContentclass serves as the base class for rich content types. 更多 …
继承者: QPlaceEditorial , QPlaceImage , QPlaceReview
def
__eq__
(other)
def
__ne__
(other)
def
attribution
()
def
setAttribution
(attribution)
def
setSupplier
(supplier)
def
setUser
(user)
def
supplier
()
def
type
()
def
user
()
Rich content such as
images,reviewsandeditorialsinherit from theQPlaceContentclass which contains common properties such as an attribution string and content contributor, which may take the form of auserand/orsupplier. It is possible that a user from a supplier is contributing content, hence both fields could be filled in simultaneously.注意
Some providers may require that the attribution string be displayed to the user whenever a piece of content is viewed.
Conversion between
QPlaceContentand it’s subclasses can be easily performed without casting. Due to the way it has been implemented, object slicing is not an issue, the following code is valid:QPlaceImage image; image.setUrl(QUrl("www.example.com")); QPlaceContent content = image; QPlaceImage image2; image2 = content; qDebug() << image2.url(); //image2.url() == "www.example.com"The rich content of a place is typically made available as paginated items. The ability to convert between
QPlaceContentand it’s subclasses means that code which handles the mechanics of paging can be easily shared for each of the sub types.At present the
QPlaceContentclass is not extensible by 3rd parties.Note: The Places API considers content objects to be ‘retrieve-only’ objects. Submission of content to a provider is not a supported use case.
QPlaceContent
¶
QPlaceContent(other)
- param other
Constructs an default content object which has no type.
Constructs a new copy of
other
.
PySide2.QtLocation.QPlaceContent.
Type
¶
Defines the type of content.
|
常量 |
描述 |
|---|---|
|
QPlaceContent.NoType |
The content object is default constructed, any other content type may be assigned to this content object |
|
QPlaceContent.ImageType |
The content object is an image |
|
QPlaceContent.ReviewType |
The content object is a review |
|
QPlaceContent.EditorialType |
The content object is an editorial |
|
QPlaceContent.CustomType |
The content object is of a custom type |
PySide2.QtLocation.QPlaceContent.
attribution
(
)
¶
unicode
Returns a rich text attribution string.
注意 : Some providers may require that the attribution of a particular content item always be displayed when the content item is shown.
另请参阅
PySide2.QtLocation.QPlaceContent.
__ne__
(
other
)
¶
other
–
QPlaceContent
bool
Returns true if this content object is not equivalent to
other
,否则返回 false。
PySide2.QtLocation.QPlaceContent.
__eq__
(
other
)
¶
other
–
QPlaceContent
bool
Returns true if this content object is equivalent to
other
,否则返回 false。
PySide2.QtLocation.QPlaceContent.
setAttribution
(
attribution
)
¶
attribution – unicode
Sets a rich text
attribution
string for this content item.
另请参阅
PySide2.QtLocation.QPlaceContent.
setSupplier
(
supplier
)
¶
supplier
–
QPlaceSupplier
设置
supplier
of the content.
另请参阅
PySide2.QtLocation.QPlaceContent.
setUser
(
user
)
¶
user
–
QPlaceUser
设置
user
who contributed this content.
另请参阅
PySide2.QtLocation.QPlaceContent.
supplier
(
)
¶
Returns the supplier who contributed this content.
另请参阅
PySide2.QtLocation.QPlaceContent.
user
(
)
¶
Returns the user who contributed this content.
另请参阅