QMediaContent 类

QMediaContent 类提供对媒体内容相关资源的访问。 更多...

头: #include <QMediaContent>
qmake: QT += multimedia

公共函数

QMediaContent (QMediaPlaylist * playlist , const QUrl & contentUrl = QUrl(), bool takeOwnership = false)
QMediaContent (const QMediaContent & other )
QMediaContent (const QNetworkRequest & request )
QMediaContent (const QUrl & url )
QMediaContent ()
QMediaContent & operator= (const QMediaContent & other )
~QMediaContent ()
bool isNull () const
QMediaPlaylist * playlist () const
QNetworkRequest request () const
bool operator!= (const QMediaContent & other ) const
bool operator== (const QMediaContent & other ) const

详细描述

QMediaContent 在多媒体框架内被用作媒体内容的逻辑句柄。QMediaContent 对象包含 QNetworkRequest which provides the URL of the content.

A non-null QMediaContent will always have a reference to the content available through the request () 方法。

Alternatively QMediaContent can represent a playlist and contain a pointer to a valid QMediaPlaylist object. In this case URL is optional and can either be empty or point to the playlist URL.

成员函数文档编制

QMediaContent:: QMediaContent ( QMediaPlaylist * playlist , const QUrl & contentUrl = QUrl(), bool takeOwnership = false)

构造媒体内容采用 playlist .

contentUrl of a playlist is an optional parameter and can be empty.

Set takeOwnership to true if you want QMediaContent to take ownership of the playlist. takeOwnership is set to false by default.

QMediaContent:: QMediaContent (const QMediaContent & other )

Constructs a copy of the media content other .

QMediaContent:: QMediaContent (const QNetworkRequest & request )

构造媒体内容采用 request 提供内容引用。

This constructor can be used to reference media content via network protocols such as HTTP. This may include additional information required to obtain the resource, such as Cookies or HTTP headers.

QMediaContent:: QMediaContent (const QUrl & url )

构造媒体内容采用 url 提供内容引用。

QMediaContent:: QMediaContent ()

Constructs a null QMediaContent.

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

Assigns the value of other to this media content.

QMediaContent:: ~QMediaContent ()

Destroys the media content object.

bool QMediaContent:: isNull () const

Returns true if this media content is null (uninitialized); false otherwise.

QMediaPlaylist *QMediaContent:: playlist () const

Returns a playlist for this media content or 0 if this QMediaContent is not a playlist.

QNetworkRequest QMediaContent:: request () const

返回 QNetworkRequest that represents the resource for this media content.

该函数在 Qt 5.14 引入。

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

返回 true 若 other is not equivalent to this media content; false otherwise.

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

返回 true 若 other is equivalent to this media content; false otherwise.