QMediaMetaData Class

Provides meta-data for media files. More...

Header: #include <QMediaMetaData>
CMake: find_package(Qt6 COMPONENTS Multimedia REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::Multimedia)
qmake: QT += multimedia

Public Functions

void insert(QMediaMetaData::Key k, const QVariant &value)
QString stringValue(QMediaMetaData::Key key) const
QVariant value(QMediaMetaData::Key key) const

Static Public Members

QString metaDataKeyToString(QMediaMetaData::Key key)

Detailed Description

Note: Not all identifiers are supported on all platforms.

Common attributes
ValueDescriptionType
TitleThe title of the media.QString
AuthorThe authors of the media.QStringList
CommentA user comment about the media.QString
DescriptionA description of the media.QString
GenreThe genre of the media.QStringList
DateThe date of the media.QDate.
LanguageThe language of media.QLocale::Language
PublisherThe publisher of the media.QString
CopyrightThe media's copyright notice.QString
UrlA Url pointing to the origin of the media.QUrl
Media attributes
MediaTypeThe type of the media (audio, video, etc).QString
FileFormatThe file format of the media.QMediaFormat::FileFormat
DurationThe duration in millseconds of the media.qint64
Audio attributes
AudioBitRateThe bit rate of the media's audio stream in bits per second.int
AudioCodecThe codec of the media's audio stream.QMediaForma::AudioCodec
Video attributes
VideoFrameRateThe frame rate of the media's video stream.qreal
VideoBitRateThe bit rate of the media's video stream in bits per second.int
VideoCodecThe codec of the media's video stream.QMediaFormat::VideoCodec
Music attributes
AlbumTitleThe title of the album the media belongs to.QString
AlbumArtistThe principal artist of the album the media belongs to.QString
ContributingArtistThe artists contributing to the media.QStringList
TrackNumberThe track number of the media.int
ComposerThe composer of the media.QStringList
LeadPerformerThe lead performer in the media.QStringList
ThumbnailImageAn embedded thumbnail image.QImage
CoverArtImageAn embedded cover art image.QImage
Image and video attributes
ResolutionThe dimensions of an image or video.QSize

Member Function Documentation

[invokable] void QMediaMetaData::insert(QMediaMetaData::Key k, const QVariant &value)

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

[static invokable] QString QMediaMetaData::metaDataKeyToString(QMediaMetaData::Key key)

returns a string representation of key that can be used when presenting meta data to users.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

[invokable] QString QMediaMetaData::stringValue(QMediaMetaData::Key key) const

Returns the meta data for key key as a QString.

This is mainly meant to simplify presenting the meta data to a user.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

[invokable] QVariant QMediaMetaData::value(QMediaMetaData::Key key) const

Returns the meta data value for Key key, or a null QVariant is not meta data for the key is available.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.