4#ifndef QMETAASSOCIATION_H
5#define QMETAASSOCIATION_H
8#pragma qt_class(QMetaAssociation)
11#include <QtCore/qiterable.h>
12#include <QtCore/qiterable_impl.h>
13#include <QtCore/qmetacontainer.h>
14#include <QtCore/qvariant.h>
35 const QMetaAssociation meta = metaContainer();
36 return QtIterablePrivate::retrieveElement(meta.keyMetaType(), [&](
void *dataPtr) {
37 meta.keyAtIterator(constIterator(), dataPtr);
60 const QMetaAssociation meta = metaContainer();
61 return QtIterablePrivate::retrieveElement(meta.keyMetaType(), [&](
void *dataPtr) {
62 meta.keyAtConstIterator(constIterator(), dataPtr);
76template<
typename Indirect>
79 const auto metaAssociation = referred.metaContainer();
80 const QMetaType metaType(metaAssociation.mappedMetaType());
81 if (metaType.isValid(QT6_CALL_NEW_OVERLOAD)) {
82 return QtIterablePrivate::retrieveElement(metaType, [&](
void *dataPtr) {
83 metaAssociation.mappedAtConstIterator(referred.constIterator(), dataPtr);
87 return QtIterablePrivate::retrieveElement(metaType, [&](
void *dataPtr) {
88 metaAssociation.keyAtConstIterator(referred.constIterator(), dataPtr);
95inline QVariant::Reference<QtMetaContainerPrivate::AssociativeIterator>::operator QVariant()
const
97 return QtPrivate::associativeIteratorToVariant(m_referred);
101inline QVariant::Reference<QtMetaContainerPrivate::AssociativeIterator> &
102QVariant::Reference<QtMetaContainerPrivate::AssociativeIterator>::operator=(
const QVariant &value)
104 const auto metaAssociation = m_referred.metaContainer();
105 const QMetaType metaType(metaAssociation.mappedMetaType());
106 if (!metaType.isValid(QT6_CALL_NEW_OVERLOAD))
109 QtPrivate::QVariantTypeCoercer coercer;
110 metaAssociation.setMappedAtIterator(
111 m_referred.constIterator(), coercer.coerce(value, metaType));
116inline QVariant::ConstReference<QtMetaContainerPrivate::AssociativeConstIterator>::operator QVariant()
const
118 return QtPrivate::associativeIteratorToVariant(m_referred);
124 return reference(*
this);
156 Association(
const T *p) : QIterable(QMetaAssociation::fromContainer<T>(), p) {}
161 Association() : QIterable(QMetaAssociation(),
nullptr) {}
163 template<
typename Pointer>
164 Association(
const QMetaAssociation &metaAssociation, Pointer iterable)
169 Association(
const QMetaAssociation &metaAssociation, QMetaType metaType,
void *iterable)
174 Association(
const QMetaAssociation &metaAssociation, QMetaType metaType,
const void *iterable)
175 : 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)