Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qmediametadata.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QMEDIAMETADATA_H
5#define QMEDIAMETADATA_H
6
7#if 0
8#pragma qt_class(QMediaMetaData)
9#endif
10
11#include <QtCore/qpair.h>
12#include <QtCore/qvariant.h>
13#include <QtCore/qstring.h>
14#include <QtCore/qhash.h>
15#include <QtMultimedia/qtmultimediaglobal.h>
16
18
19// Class forward declaration required for QDoc bug
20class QString;
21
22class Q_MULTIMEDIA_EXPORT QMediaMetaData
23{
25public:
64 Q_ENUM(Key)
65
66 static constexpr int NumMetaData = HasHdrContent + 1;
67
68// QMetaType typeForKey(Key k);
69 Q_INVOKABLE QVariant value(Key k) const { return data.value(k); }
70 Q_INVOKABLE void insert(Key k, const QVariant &value) { data.insert(k, value); }
71 Q_INVOKABLE void remove(Key k) { data.remove(k); }
72 Q_INVOKABLE QList<Key> keys() const { return data.keys(); }
73
74 QVariant &operator[](Key k) { return data[k]; }
75 Q_INVOKABLE void clear() { data.clear(); }
76
77 Q_INVOKABLE bool isEmpty() const { return data.isEmpty(); }
78 Q_INVOKABLE QString stringValue(Key k) const;
79
80 Q_INVOKABLE static QString metaDataKeyToString(Key k);
81
82protected:
83 friend bool operator==(const QMediaMetaData &a, const QMediaMetaData &b)
84 { return a.data == b.data; }
85 friend bool operator!=(const QMediaMetaData &a, const QMediaMetaData &b)
86 { return a.data != b.data; }
87
88 static QMetaType keyType(Key key);
89
90 QHash<Key, QVariant> data;
91};
92
94
96
97#endif // QMEDIAMETADATA_H
\inmodule QtMultimedia
friend bool operator==(const QMediaMetaData &a, const QMediaMetaData &b)
Compares two meta data objects a and b, and returns true if they are identical or false if they diffe...
QVariant & operator[](Key k)
Returns data stored at the Key {k}.
Q_INVOKABLE bool isEmpty() const
\qmlmethod bool QtMultimedia::mediaMetaData::isEmpty() Returns true if the meta data contains no item...
Q_INVOKABLE void remove(Key k)
\qmlmethod void QtMultimedia::mediaMetaData::remove(Key k) Removes meta data from a Key: {k}.
Q_INVOKABLE void insert(Key k, const QVariant &value)
\qmlmethod void QtMultimedia::mediaMetaData::insert(Key k, variant value) Inserts a value into a Key:...
QHash< Key, QVariant > data
friend bool operator!=(const QMediaMetaData &a, const QMediaMetaData &b)
Compares two meta data objects a and b, and returns false if they are identical or true if they diffe...
Q_INVOKABLE QList< Key > keys() const
\qmlmethod list<Key> QtMultimedia::mediaMetaData::keys() Returns a list of MediaMetaData....
Q_INVOKABLE void clear()
\qmlmethod void QtMultimedia::mediaMetaData::clear() Removes all data from the MediaMetaData object.
Key
Provides meta-data for media files.
\inmodule QtCore
Definition qmetatype.h:341
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qvariant.h:65
T value() const &
Definition qvariant.h:516
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define Q_DECLARE_METATYPE(TYPE)
Definition qmetatype.h:1525
GLboolean GLboolean GLboolean b
GLuint64 key
GLboolean GLboolean GLboolean GLboolean a
[7]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
#define Q_ENUM(x)
#define Q_INVOKABLE
#define Q_GADGET