5#ifndef QMETAASSOCIATION_H
6#define QMETAASSOCIATION_H
9#pragma qt_class(QMetaAssociation)
12#include <QtCore/qiterable.h>
13#include <QtCore/qiterable_impl.h>
14#include <QtCore/qmetacontainer.h>
15#include <QtCore/qvariant.h>
36 const QMetaAssociation meta = metaContainer();
37 return QtIterablePrivate::retrieveElement(meta.keyMetaType(), [&](
void *dataPtr) {
38 meta.keyAtIterator(constIterator(), dataPtr);
61 const QMetaAssociation meta = metaContainer();
62 return QtIterablePrivate::retrieveElement(meta.keyMetaType(), [&](
void *dataPtr) {
63 meta.keyAtConstIterator(constIterator(), dataPtr);
77template<
typename Indirect>
80 const auto metaAssociation = referred.metaContainer();
81 const QMetaType metaType(metaAssociation.mappedMetaType());
82 if (metaType.isValid(QT6_CALL_NEW_OVERLOAD)) {
83 return QtIterablePrivate::retrieveElement(metaType, [&](
void *dataPtr) {
84 metaAssociation.mappedAtConstIterator(referred.constIterator(), dataPtr);
88 return QtIterablePrivate::retrieveElement(metaType, [&](
void *dataPtr) {
89 metaAssociation.keyAtConstIterator(referred.constIterator(), dataPtr);
96inline QVariant::Reference<QtMetaContainerPrivate::AssociativeIterator>::operator QVariant()
const
98 return QtPrivate::associativeIteratorToVariant(m_referred);
102inline QVariant::Reference<QtMetaContainerPrivate::AssociativeIterator> &
103QVariant::Reference<QtMetaContainerPrivate::AssociativeIterator>::operator=(
const QVariant &value)
105 const auto metaAssociation = m_referred.metaContainer();
106 const QMetaType metaType(metaAssociation.mappedMetaType());
107 if (!metaType.isValid(QT6_CALL_NEW_OVERLOAD))
110 QtPrivate::QVariantTypeCoercer coercer;
111 metaAssociation.setMappedAtIterator(
112 m_referred.constIterator(), coercer.coerce(value, metaType));
117inline QVariant::ConstReference<QtMetaContainerPrivate::AssociativeConstIterator>::operator QVariant()
const
119 return QtPrivate::associativeIteratorToVariant(m_referred);
125 return reference(*
this);
157 Association(
const T *p) : QIterable(QMetaAssociation::fromContainer<T>(), p) {}
162 Association() : QIterable(QMetaAssociation(),
nullptr) {}
164 template<
typename Pointer>
165 Association(
const QMetaAssociation &metaAssociation, Pointer iterable)
170 Association(
const QMetaAssociation &metaAssociation, QMetaType metaType,
void *iterable)
175 Association(
const QMetaAssociation &metaAssociation, QMetaType metaType,
const void *iterable)
176 : QIterable(metaAssociation, metaType.alignOf(), iterable)
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
QCborArray toArray(const QCborArray &a) const
QCborMap toMap(const QCborMap &m) const
QVariant toVariant() const
QCborValueConstRef & operator=(const QCborValueConstRef &)=delete
QCborArray toArray() const
bool toBool(bool defaultValue=false) const
QCborValue taggedValue(const QCborValue &defaultValue=QCborValue()) const
QCborSimpleType toSimpleType(QCborSimpleType defaultValue=QCborSimpleType::Undefined) const
bool isSimpleType() const
bool isRegularExpression() const
QCborValue::Type type() const
QCborValueConstRef(const QCborValueConstRef &)=default
QCborTag tag(QCborTag defaultValue=QCborTag(-1)) const
constexpr QCborValueConstRef()
QByteArray toByteArray(const QByteArray &defaultValue={}) const
qint64 toInteger(qint64 defaultValue=0) const
bool isSimpleType(QCborSimpleType st) const
QUuid toUuid(const QUuid &defaultValue={}) const
QCborContainerPrivate * d
QAnyStringView toStringView(QAnyStringView defaultValue={}) const
friend bool comparesEqual(const QCborValueConstRef &lhs, const QCborValueConstRef &rhs) noexcept
friend bool comparesEqual(const QCborValueConstRef &lhs, const QCborValue &rhs) noexcept
QString toDiagnosticNotation(QCborValue::DiagnosticNotationOptions opt=QCborValue::Compact) const
int compare(const QCborValue &other) const
friend Qt::strong_ordering compareThreeWay(const QCborValueConstRef &lhs, const QCborValue &rhs) noexcept
operator QCborValue() const
friend Qt::strong_ordering compareThreeWay(const QCborValueConstRef &lhs, const QCborValueConstRef &rhs) noexcept
constexpr QCborValueConstRef(QCborContainerPrivate *dd, qsizetype ii)
QCborValue concrete() const noexcept
QString toString(const QString &defaultValue={}) const
QUrl toUrl(const QUrl &defaultValue={}) const
QJsonValue toJsonValue() const
double toDouble(double defaultValue=0) const
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
friend bool comparesEqual(const QJsonValueConstRef &lhs, const QJsonValue &rhs)
constexpr QJsonValueConstRef(QCborContainerPrivate *d, size_t index, bool is_object)
friend bool comparesEqual(const QJsonValueConstRef &lhs, const QJsonValueConstRef &rhs)
operator QJsonValue() const
QAnyStringView objectKeyView() const
void rebind(QJsonValueConstRef other)
QString objectKey() const
QAnyStringView toStringView(QAnyStringView defaultValue={}) const
QJsonValueConstRef(const QJsonValueConstRef &)=default
qint64 toInteger(qint64 defaultValue=0) const
bool toBool(bool defaultValue=false) const
QJsonValueConstRef & operator=(const QJsonValueConstRef &)=delete
QString toString(const QString &defaultValue={}) const
QJsonValue::Type type() const
QJsonValueConstRef(QJsonArray *array, qsizetype idx)
QCborContainerPrivate * d
QJsonValueConstRef(QJsonObject *object, qsizetype idx)
double toDouble(double defaultValue=0) const
int toInt(int defaultValue=0) const
const QJsonValue operator[](QStringView key) const
\inmodule QtCore\reentrant
\inmodule QtCore\compares equality \compareswith equality QLine \endcompareswith
\inmodule QtCore\compares equality \compareswith equality QLineF \endcompareswith
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\keyword 16-bit Floating Point Support\inmodule QtCore \inheaderfile QFloat16
Combined button and popup list for selecting options.
QVariant associativeIteratorToVariant(const Indirect &referred)
QMutableListIterator< QByteArray > QMutableByteArrayListIterator
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
QList< QVariant > QVariantList
Q_DECLARE_TYPEINFO(QLine, Q_PRIMITIVE_TYPE)
Q_DECLARE_TYPEINFO(QLineF, Q_PRIMITIVE_TYPE)
#define qCWarning(category,...)
#define Q_STATIC_LOGGING_CATEGORY(name,...)
#define QStringLiteral(str)
\inmodule QtCore\reentrant
QString errorString() const
\variable QCborParserError::offset
~QListSpecialMethods()=default
QListSpecialMethods & operator=(const QListSpecialMethods &)=default
QListSpecialMethods(QListSpecialMethods &&)=default
QListSpecialMethods & operator=(QListSpecialMethods &&)=default
QListSpecialMethods()=default
QListSpecialMethods(const QListSpecialMethods &)=default
QByteArray join(QByteArrayView sep={}) const
static T value(const Iterator &it)
static T value(Iterator &it)
static QCborValueConstRef key(Iterator &it)
static QCborValueConstRef key(const Iterator &it)
static QAnyStringView key(Iterator &it)
static T value(const Iterator &it)
static QAnyStringView key(const Iterator &it)
static T value(Iterator &it)