Qt 6.x
The Qt SDK
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:
26 enum Key {
33
38
42
48
55
58
60 Resolution
61 };
62 Q_ENUM(Key)
63
64 static constexpr int NumMetaData = Resolution + 1;
65
66// QMetaType typeForKey(Key k);
67 Q_INVOKABLE QVariant value(Key k) const { return data.value(k); }
68 Q_INVOKABLE void insert(Key k, const QVariant &value) { data.insert(k, value); }
69 Q_INVOKABLE void remove(Key k) { data.remove(k); }
70 Q_INVOKABLE QList<Key> keys() const { return data.keys(); }
71
72 QVariant &operator[](Key k) { return data[k]; }
73 Q_INVOKABLE void clear() { data.clear(); }
74
75 Q_INVOKABLE bool isEmpty() const { return data.isEmpty(); }
76 Q_INVOKABLE QString stringValue(Key k) const;
77
78 Q_INVOKABLE static QString metaDataKeyToString(Key k);
79
80protected:
81 friend bool operator==(const QMediaMetaData &a, const QMediaMetaData &b)
82 { return a.data == b.data; }
83 friend bool operator!=(const QMediaMetaData &a, const QMediaMetaData &b)
84 { return a.data != b.data; }
85
86 static QMetaType keyType(Key key);
87
89};
90
92
94
95#endif // QMEDIAMETADATA_H
\inmodule QtCore
Definition qhash.h:818
Definition qlist.h:74
\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.
\inmodule QtCore
Definition qmetatype.h:320
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
\inmodule QtCore
Definition qvariant.h:64
T value() const &
Definition qvariant.h:511
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define Q_DECLARE_METATYPE(TYPE)
Definition qmetatype.h:1504
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