19#if QT_CONFIG(easingcurve)
24#if QT_CONFIG(regularexpression)
28#ifndef QT_BOOTSTRAPPED
48#if QT_CONFIG(itemmodel)
52#ifndef QT_NO_GEOM_VARIANT
64#define NS(x) QT_PREPEND_NAMESPACE(x)
71struct QMetaTypeDeleter
74 void operator()(
void *
data)
76 if (iface->alignment > __STDCPP_DEFAULT_NEW_ALIGNMENT__) {
77 operator delete(
data, std::align_val_t(iface->alignment));
79 operator delete(
data);
84struct QMetaTypeCustomRegistry
87#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) && !defined(QT_BOOTSTRAPPED)
88 QMetaTypeCustomRegistry()
96 aliases.insert(
"qfloat16", QtPrivate::qMetaTypeInterfaceForType<qfloat16>());
101 QList<const QtPrivate::QMetaTypeInterface *> registry;
102 QHash<QByteArray, const QtPrivate::QMetaTypeInterface *> aliases;
113 if (
int id = ti->typeId.loadRelaxed())
120 if (
auto ti2 = aliases.value(
name)) {
121 const auto id = ti2->typeId.loadRelaxed();
122 ti->typeId.storeRelaxed(
id);
126 int size = registry.size();
127 while (firstEmpty <
size && registry[firstEmpty])
129 if (firstEmpty <
size) {
130 registry[firstEmpty] = ti;
134 firstEmpty = registry.size();
138 if (ti->legacyRegisterOp)
139 ti->legacyRegisterOp();
140 return ti->typeId.loadRelaxed();
143 void unregisterDynamicType(
int id)
150 auto &ti = registry[idx];
153 aliases.removeIf([ti] (
const auto &kv) {
return kv.value() == ti; });
157 firstEmpty = std::min(firstEmpty, idx);
175 const char *
name =
nullptr;
176 if (!customTypeRegistry.exists())
178 QMetaTypeCustomRegistry *
r = &*customTypeRegistry;
183 auto end =
r->aliases.constEnd();
185 if (
it.value() != type_d)
187 if (
it.key() == officialName)
189 name =
it.key().constData();
197 if (
it.value() == type_d &&
it.key() != officialName)
198 otherNames <<
it.key();
201 if (!otherNames.isEmpty())
202 qWarning(
"QMetaType: type %s has more than one typedef alias: %s, %s",
203 type_d->name,
name, otherNames.join(
", ").constData());
558 auto reg = customTypeRegistry();
560 return reg->registerCustomType(
iface);
645 std::unique_ptr<void, QMetaTypeDeleter> where(
nullptr, {d_ptr});
646 if (d_ptr->
alignment > __STDCPP_DEFAULT_NEW_ALIGNMENT__)
647 where.reset(
operator new(d_ptr->
size, std::align_val_t(d_ptr->
alignment)));
649 where.reset(
operator new(d_ptr->
size));
652 return where.release();
668 QMetaTypeDeleter{d_ptr}(
data);
728 std::less<const void *> less;
729 if (less(ptr1, ptr2))
731 if (less(ptr2, ptr1))
768 *
reinterpret_cast<const void *
const *
>(rhs));
772 if (d_ptr->
lessThan(d_ptr, lhs, rhs))
774 if (d_ptr->
lessThan(d_ptr, rhs, lhs))
804 return *
reinterpret_cast<const void *
const *
>(lhs) == *
reinterpret_cast<const void *
const *
>(rhs);
807 return d_ptr->
equals(d_ptr, lhs, rhs);
914 if (
auto reg = customTypeRegistry()) {
915 Q_ASSERT(reg->getCustomType(typeId) == d_ptr);
916 reg->unregisterDynamicType(typeId);
951#define QT_ADD_STATIC_METATYPE(MetaTypeName, MetaTypeId, RealName) \
952 { #RealName, sizeof(#RealName) - 1, MetaTypeId },
954#define QT_ADD_STATIC_METATYPE_ALIASES_ITER(MetaTypeName, MetaTypeId, AliasingName, RealNameStr) \
955 { RealNameStr, sizeof(RealNameStr) - 1, QMetaType::MetaTypeName },
969 template<
typename T,
typename LiteralWrapper =
971 static inline bool convertToBool(
const T &
source)
974 return !(
str.
isEmpty() ||
str == LiteralWrapper(
"0") ||
str == LiteralWrapper(
"false"));
989 bool convert(
const void *from,
int fromTypeId,
void *to,
int toTypeId)
const override
994 bool onlyCheck = (from ==
nullptr && to ==
nullptr);
997 Q_ASSERT(onlyCheck || (
bool(from) &&
bool(to)));
1000 using SChar =
signed char;
1001 using UChar =
unsigned char;
1002 using Short = short;
1003 using UShort =
unsigned short;
1005 using UInt =
unsigned int;
1008 using ULong =
unsigned long;
1010 using Float = float;
1013 using Nullptr = std::nullptr_t;
1014 using Char16 = char16_t;
1015 using Char32 = char32_t;
1017#define QMETATYPE_CONVERTER_ASSIGN_DOUBLE(To, From) \
1018 QMETATYPE_CONVERTER(To, From, result = double(source); return true;)
1019#define QMETATYPE_CONVERTER_ASSIGN_NUMBER(To, From) \
1020 QMETATYPE_CONVERTER(To, From, result = To::number(source); return true;)
1021#ifndef QT_BOOTSTRAPPED
1022#define CONVERT_CBOR_AND_JSON(To) \
1023 QMETATYPE_CONVERTER(To, QCborValue, \
1024 if constexpr(std::is_same_v<To, Bool>) { \
1025 if (!source.isBool()) \
1027 result = source.toBool(); \
1029 if (!source.isInteger() && !source.isDouble()) \
1031 if constexpr(std::is_integral_v<To>) \
1032 result = source.toInteger(); \
1034 result = source.toDouble(); \
1038 QMETATYPE_CONVERTER(To, QJsonValue, \
1039 if constexpr(std::is_same_v<To, Bool>) { \
1040 if (!source.isBool()) \
1042 result = source.toBool(); \
1044 if (!source.isDouble()) \
1046 if constexpr(std::is_integral_v<To>) \
1047 result = source.toInteger(); \
1049 result = source.toDouble(); \
1054#define CONVERT_CBOR_AND_JSON(To)
1057#define INTEGRAL_CONVERTER(To) \
1058 QMETATYPE_CONVERTER_ASSIGN(To, Bool); \
1059 QMETATYPE_CONVERTER_ASSIGN(To, Char); \
1060 QMETATYPE_CONVERTER_ASSIGN(To, UChar); \
1061 QMETATYPE_CONVERTER_ASSIGN(To, SChar); \
1062 QMETATYPE_CONVERTER_ASSIGN(To, Short); \
1063 QMETATYPE_CONVERTER_ASSIGN(To, UShort); \
1064 QMETATYPE_CONVERTER_ASSIGN(To, Int); \
1065 QMETATYPE_CONVERTER_ASSIGN(To, UInt); \
1066 QMETATYPE_CONVERTER_ASSIGN(To, Long); \
1067 QMETATYPE_CONVERTER_ASSIGN(To, ULong); \
1068 QMETATYPE_CONVERTER_ASSIGN(To, LongLong); \
1069 QMETATYPE_CONVERTER_ASSIGN(To, ULongLong); \
1070 QMETATYPE_CONVERTER(To, Float, result = qRound64(source); return true;); \
1071 QMETATYPE_CONVERTER(To, Double, result = qRound64(source); return true;); \
1072 QMETATYPE_CONVERTER(To, QChar, result = source.unicode(); return true;); \
1073 QMETATYPE_CONVERTER(To, QString, \
1075 if constexpr(std::is_same_v<To, bool>) \
1076 result = (ok = true, convertToBool(source)); \
1077 else if constexpr(std::is_signed_v<To>) \
1078 result = To(source.toLongLong(&ok)); \
1080 result = To(source.toULongLong(&ok)); \
1083 QMETATYPE_CONVERTER(To, QByteArray, \
1085 if constexpr(std::is_same_v<To, bool>) \
1086 result = (ok = true, convertToBool(source)); \
1087 else if constexpr(std::is_signed_v<To>) \
1088 result = To(source.toLongLong(&ok)); \
1090 result = To(source.toULongLong(&ok)); \
1093 CONVERT_CBOR_AND_JSON(To)
1095#define FLOAT_CONVERTER(To) \
1096 QMETATYPE_CONVERTER_ASSIGN(To, Bool); \
1097 QMETATYPE_CONVERTER_ASSIGN(To, Char); \
1098 QMETATYPE_CONVERTER_ASSIGN(To, UChar); \
1099 QMETATYPE_CONVERTER_ASSIGN(To, SChar); \
1100 QMETATYPE_CONVERTER_ASSIGN(To, Short); \
1101 QMETATYPE_CONVERTER_ASSIGN(To, UShort); \
1102 QMETATYPE_CONVERTER_ASSIGN(To, Int); \
1103 QMETATYPE_CONVERTER_ASSIGN(To, UInt); \
1104 QMETATYPE_CONVERTER_ASSIGN(To, Long); \
1105 QMETATYPE_CONVERTER_ASSIGN(To, ULong); \
1106 QMETATYPE_CONVERTER_ASSIGN(To, LongLong); \
1107 QMETATYPE_CONVERTER_ASSIGN(To, ULongLong); \
1108 QMETATYPE_CONVERTER_ASSIGN(To, Float); \
1109 QMETATYPE_CONVERTER_ASSIGN(To, Double); \
1110 QMETATYPE_CONVERTER(To, QString, \
1112 result = source.toDouble(&ok); \
1115 QMETATYPE_CONVERTER(To, QByteArray, \
1117 result = source.toDouble(&ok); \
1120 CONVERT_CBOR_AND_JSON(To)
1122 switch (makePair(toTypeId, fromTypeId)) {
1140#ifndef QT_BOOTSTRAPPED
1144 result = source.toUrl();
1150#if QT_CONFIG(itemmodel)
1156#define QMETATYPE_CONVERTER_ASSIGN_QCHAR(From) \
1157 QMETATYPE_CONVERTER(QChar, From, result = QChar::fromUcs2(source); return true;)
1218#if QT_CONFIG(datestring)
1227#ifndef QT_BOOTSTRAPPED
1231 result = source.toString();
1271#ifndef QT_NO_GEOM_VARIANT
1284#ifndef QT_NO_VARIANT
1322#ifndef QT_BOOTSTRAPPED
1332 if (
source.isByteArray()) {
1333 result = source.toByteArray();
1366#if QT_CONFIG(regularexpression)
1369 if (!
source.isRegularExpression())
1433 if (
source.isDateTime()) {
1434 result = source.toDateTime();
1442 if (
source.isSimpleType()) {
1443 result = source.toSimpleType();
1642#if QT_CONFIG(datestring)
1676template<
typename T,
typename Key>
1689 return map.contains(k);
1697 if (map.size() == oldSize)
1706 auto it = map.find(k);
1707 return it == map.end() ?
nullptr : std::addressof(*
it);
1712 const Key k(from, to);
1722 = QMetaTypeFunctionRegistry<QMetaType::ConverterFunction, std::pair<int,int>>;
1783 if (!customTypesConversionRegistry()->insertIfNotContains({from.id(), to.id()},
f)) {
1784 qWarning(
"Type conversion already registered from type %s to type %s",
1785 from.name(), to.name());
1816 if (!customTypesMutableViewRegistry()->insertIfNotContains({from.
id(), to.
id()},
f)) {
1817 qWarning(
"Mutable view on type already registered from type %s to type %s",
1829 if (customTypesMutableViewRegistry.isDestroyed())
1831 customTypesMutableViewRegistry()->remove(from.
id(), to.
id());
1841 if (customTypesConversionRegistry.isDestroyed())
1843 customTypesConversionRegistry()->remove(from.
id(), to.
id());
1846#ifndef QT_NO_DEBUG_STREAM
1856 return d.nospace() <<
"QMetaType(" <<
m.name() <<
")";
1867 dbg << *reinterpret_cast<const void * const *>(rhs);
1912#ifndef QT_NO_QOBJECT
1926 enumName = enumName.
sliced(qflagsNamePrefix.size());
1929 enumName = enumName.
sliced(lastColon + 1);
1942 switch (fromType.
sizeOf()) {
1944 ull = *
static_cast<const unsigned char *
>(from);
1947 ull = *
static_cast<const unsigned short *
>(from);
1950 ull = *
static_cast<const unsigned int *
>(from);
1953 ull = *
static_cast<const quint64 *
>(from);
1958 if (toType.id() == QMetaType::ULongLong) {
1962 if (toType.id() != QMetaType::QString && toType.id() != QMetaType::QByteArray)
1966 switch (fromType.
sizeOf()) {
1968 ll = *
static_cast<const signed char *
>(from);
1971 ll = *
static_cast<const short *
>(from);
1974 ll = *
static_cast<const int *
>(from);
1977 ll = *
static_cast<const qint64 *
>(from);
1982 if (toType.id() == QMetaType::LongLong) {
1986 if (toType.id() != QMetaType::QString && toType.id() != QMetaType::QByteArray)
1989#ifndef QT_NO_QOBJECT
1994 if (toType.id() == QMetaType::QString)
1999 const char *
key = en.valueToKey(
static_cast<int>(ll));
2000 if (toType.id() == QMetaType::QString)
2008 if (toType.id() == QMetaType::QString || toType.id() == QMetaType::QByteArray)
2015 int fromTypeId = fromType.
id();
2018#ifndef QT_NO_QOBJECT
2019 if (fromTypeId == QMetaType::QString || fromTypeId == QMetaType::QByteArray) {
2030 if (fromTypeId == QMetaType::LongLong) {
2041 switch (toType.sizeOf()) {
2043 *
static_cast<signed char *
>(to) =
value;
2055 Q_UNREACHABLE_RETURN(
false);
2059#ifndef QT_BOOTSTRAPPED
2085 h.insert(
it.key().toString(),
it.value());
2100 h.insert(
it.key().toString(),
it.value());
2106 const int targetId = qMetaTypeId<QtMetaTypePrivate::QPairVariantInterfaceImpl>();
2107 const auto f = customTypesConversionRegistry()->function({fromType.
id(), targetId});
2117 if (pi._metaType_first == QMetaType::fromType<QVariant>())
2120 dataPtr =
v1.data();
2124 if (pi._metaType_second == QMetaType::fromType<QVariant>())
2127 dataPtr =
v2.data();
2137 const int fromTypeId = fromType.
id();
2140 switch (fromTypeId) {
2141 case QMetaType::QVariantList:
2144 case QMetaType::QStringList:
2147 case QMetaType::QByteArrayList:
2150 case QMetaType::QString:
2153 case QMetaType::QByteArray:
2160 i = std::move(impl);
2171 switch (fromType.
id()) {
2172 case QMetaType::QVariantList:
2173 case QMetaType::QStringList:
2174 case QMetaType::QByteArrayList:
2175 case QMetaType::QString:
2176 case QMetaType::QByteArray:
2185 switch (fromType.
id()) {
2186 case QMetaType::QVariantList:
2187 case QMetaType::QStringList:
2188 case QMetaType::QByteArrayList:
2189 case QMetaType::QString:
2190 case QMetaType::QByteArray:
2201 const int fromTypeId = fromType.
id();
2204 switch (fromTypeId) {
2205 case QMetaType::QVariantList:
2208 case QMetaType::QStringList:
2211 case QMetaType::QByteArrayList:
2214 case QMetaType::QString:
2217 case QMetaType::QByteArray:
2238 if (fromType.
id() == QMetaType::QVariantMap) {
2242 if (fromType.
id() == QMetaType::QVariantHash) {
2250 i = std::move(impl);
2272 switch (fromType.
id()) {
2273 case QMetaType::QVariantMap:
2274 case QMetaType::QVariantHash:
2283 switch (fromType.
id()) {
2284 case QMetaType::QVariantMap:
2285 case QMetaType::QVariantHash:
2296 int fromTypeId = fromType.
id();
2299 if (fromTypeId == QMetaType::QVariantMap) {
2303 if (fromTypeId == QMetaType::QVariantHash) {
2324 if (fromObject && fromObject->metaObject()->
inherits(toType.metaObject())) {
2325 *
static_cast<QObject **
>(to) = toType.metaObject()->cast(fromObject);
2327 }
else if (!fromObject && fromType.
metaObject()) {
2329 *
static_cast<void **
>(to) =
nullptr;
2330 return fromType.
metaObject()->inherits(toType.metaObject());
2336 if (
f &&
t &&
f->inherits(
t)) {
2337 toType.destruct(to);
2338 toType.construct(to, from);
2368 if (!
fromType.isValid() || !toType.isValid())
2379 int toTypeId = toType.id();
2382 if (moduleHelper->convert(from, fromTypeId, to, toTypeId))
2385 const auto f = customTypesConversionRegistry()->function({fromTypeId, toTypeId});
2387 return (*
f)(from, to);
2393 if (toTypeId == Nullptr) {
2394 *
static_cast<std::nullptr_t *
>(to) =
nullptr;
2396 if (*
static_cast<const void *
const *
>(from) ==
nullptr)
2401#ifndef QT_BOOTSTRAPPED
2402# ifndef QT_NO_VARIANT
2417 if (toTypeId == qMetaTypeId<QSequentialIterable>())
2420 if (toTypeId == qMetaTypeId<QAssociativeIterable>())
2436 if (!
fromType.isValid() || !toType.isValid())
2440 int toTypeId = toType.id();
2442 const auto f = customTypesMutableViewRegistry()->function({fromTypeId, toTypeId});
2444 return (*
f)(from, to);
2446#ifndef QT_BOOTSTRAPPED
2447 if (toTypeId == qMetaTypeId<QSequentialIterable>())
2450 if (toTypeId == qMetaTypeId<QAssociativeIterable>())
2479 int toTypeId = toType.id();
2484 const auto f = customTypesMutableViewRegistry()->function({fromTypeId, toTypeId});
2488#ifndef QT_BOOTSTRAPPED
2489 if (toTypeId == qMetaTypeId<QSequentialIterable>())
2492 if (toTypeId == qMetaTypeId<QAssociativeIterable>())
2576 int toTypeId = toType.id();
2581 if (fromTypeId == toTypeId)
2585 if (moduleHelper->convert(
nullptr, fromTypeId,
nullptr, toTypeId))
2589 customTypesConversionRegistry()->function(std::make_pair(fromTypeId, toTypeId));
2593#ifndef QT_BOOTSTRAPPED
2594 if (toTypeId == qMetaTypeId<QSequentialIterable>())
2597 if (toTypeId == qMetaTypeId<QAssociativeIterable>())
2600#ifndef QT_NO_VARIANT
2612 fromType, QMetaType::fromType<QtMetaTypePrivate::QPairVariantInterfaceImpl>()))
2628#ifndef QT_BOOTSTRAPPED
2659 return customTypesConversionRegistry()->contains({
fromType.id(), toType.id()});
2668 const QMetaType to = QMetaType::fromType<QtMetaTypePrivate::QPairVariantInterfaceImpl>();
2678 const QMetaType to = QMetaType::fromType<QIterable<QMetaSequence>>();
2688 const QMetaType to = QMetaType::fromType<QIterable<QMetaAssociation>>();
2706 return customTypesMutableViewRegistry()->contains({
fromType.id(), toType.id()});
2715 const QMetaType to = QMetaType::fromType<QIterable<QMetaSequence>>();
2725 const QMetaType to = QMetaType::fromType<QIterable<QMetaAssociation>>();
2771 if (customTypeRegistry.exists()) {
2772 auto reg = &*customTypeRegistry;
2773#if QT_CONFIG(thread)
2774 Q_ASSERT(!reg->lock.tryLockForWrite());
2777 return ti->typeId.loadRelaxed();
2795 if (
auto reg = customTypeRegistry()) {
2797 auto &al = reg->aliases[normalizedTypeName];
2800 al = metaType.d_ptr;
2809 if (customTypeRegistry.exists())
2810 iface = customTypeRegistry->getCustomType(typeId);
2813 iface = moduleHelper->interfaceForType(typeId);
2829template <
bool tryNormalizedType>
2838#ifndef QT_NO_QOBJECT
2842 normalizedTypeName.size());
2845 normalizedTypeName.size());
2888#ifndef QT_NO_DATASTREAM
2906 if (
id() == QMetaType::Long) {
2909 }
else if (
id() == QMetaType::ULong) {
2944 if (
id() == QMetaType::Long) {
2947 *(
long *)
data =
long(ll);
2949 }
else if (
id() == QMetaType::ULong) {
2952 *(
unsigned long *)
data = (
unsigned long)(ull);
2971 if (
type == QMetaType::Long ||
type == QMetaType::ULong)
3001 return QMetaType::fromType<quint8>();
3003 return QMetaType::fromType<quint16>();
3005 return QMetaType::fromType<quint32>();
3007 return QMetaType::fromType<quint64>();
3014 return QMetaType::fromType<qint8>();
3016 return QMetaType::fromType<qint16>();
3018 return QMetaType::fromType<qint32>();
3020 return QMetaType::fromType<qint64>();
3256 qWarning(
"Trying to construct an instance of an invalid type, type id: %i", typeId);
3285#if !defined(QT_BOOTSTRAPPED) && !defined(Q_CC_MSVC) && !defined(Q_OS_INTEGRITY)
3288#define QT_METATYPE_DECLARE_TEMPLATE_ITER(TypeName, Id, Name) \
3289 template class QMetaTypeForType<Name>; \
3290 template struct QMetaTypeInterfaceWrapper<Name>;
3297#undef QT_METATYPE_DECLARE_TEMPLATE_ITER
The QAssociativeIterable class is an iterable interface for an associative container in a QVariant.
T loadRelaxed() const noexcept
bool endsWith(char c) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
void chop(qsizetype n)
Removes n bytes from the end of the byte array.
bool startsWith(QByteArrayView bv) const
static QByteArray number(int, int base=10)
Returns a byte-array representing the whole number n as text.
QByteArray sliced(qsizetype pos) const &
qsizetype lastIndexOf(char c, qsizetype from=-1) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QByteArray fromRawData(const char *data, qsizetype size)
Constructs a QByteArray that uses the first size bytes of the data array.
\inmodule QtCore\reentrant
QVariantList toVariantList() const
Recursively converts each \l QCborValue in this array using QCborValue::toVariant() and returns the Q...
static QCborArray fromJsonArray(const QJsonArray &array)
Converts all JSON items found in the array array to CBOR using QCborValue::fromJson(),...
QJsonArray toJsonArray() const
Recursively converts every \l QCborValue element in this array to JSON using QCborValue::toJsonValue(...
static QCborArray fromStringList(const QStringList &list)
Returns a QCborArray containing all the strings found in the list list.
static QCborArray fromVariantList(const QVariantList &list)
Converts all the items in the list to CBOR using QCborValue::fromVariant() and returns the array comp...
\inmodule QtCore\reentrant
QVariantMap toVariantMap() const
Converts the CBOR values to QVariant using QCborValue::toVariant() and "stringifies" all the CBOR key...
QVariantHash toVariantHash() const
Converts the CBOR values to QVariant using QCborValue::toVariant() and "stringifies" all the CBOR key...
QJsonObject toJsonObject() const
Recursively converts every \l QCborValue value in this map to JSON using QCborValue::toJsonValue() an...
static QCborMap fromJsonObject(const QJsonObject &o)
Converts all JSON items found in the obj object to CBOR using QCborValue::fromJson(),...
static QCborMap fromVariantMap(const QVariantMap &map)
Converts all the items in map to CBOR using QCborValue::fromVariant() and returns the map composed of...
static QCborMap fromVariantHash(const QVariantHash &hash)
Converts all the items in hash to CBOR using QCborValue::fromVariant() and returns the map composed o...
\inmodule QtCore\reentrant
bool isNull() const
Returns true if this QCborValue is of the null type.
QJsonValue toJsonValue() const
Converts this QCborValue object to an equivalent representation in JSON and returns it as a QJsonValu...
static QCborValue fromJsonValue(const QJsonValue &v)
Converts the JSON value contained in v into its corresponding CBOR value and returns it.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
QTime time() const
Returns the time part of the datetime.
QDate date() const
Returns the date part of the datetime.
\inmodule QtCore \reentrant
QDateTime startOfDay(const QTimeZone &zone) const
void clear() noexcept(std::is_nothrow_destructible< Node >::value)
Removes all items from the hash and frees up all memory used by it.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
\inmodule QtCore\reentrant
static QJsonArray fromStringList(const QStringList &list)
Converts the string list list to a QJsonArray.
static QJsonArray fromVariantList(const QVariantList &list)
Converts the variant list list to a QJsonArray.
QVariantList toVariantList() const
Converts this object to a QVariantList.
\inmodule QtCore\reentrant
bool isArray() const
Returns true if the document contains an array.
\inmodule QtCore\reentrant
QVariantMap toVariantMap() const
Converts this object to a QVariantMap.
static QJsonObject fromVariantMap(const QVariantMap &map)
Converts the variant map map to a QJsonObject.
QVariantHash toVariantHash() const
Converts this object to a QVariantHash.
static QJsonObject fromVariantHash(const QVariantHash &map)
Converts the variant hash hash to a QJsonObject.
\inmodule QtCore\reentrant
bool isNull() const
Returns true if the value is null.
\inmodule QtCore\compares equality \compareswith equality QLine \endcompareswith
constexpr QLine toLine() const
Returns an integer-based copy of this line.
\inmodule QtCore\compares equality \compareswith equality QLineF \endcompareswith
qsizetype size() const noexcept
void reserve(qsizetype size)
iterator insert(const Key &key, const T &value)
bool inherits(const char *classname) const
Returns true if this object is an instance of a class that inherits className or a QObject subclass t...
\variable Qt::partial_ordering::less
static const QPartialOrdering Less
static const QPartialOrdering Greater
static const QPartialOrdering Equivalent
static const QPartialOrdering Unordered
\inmodule QtCore\reentrant
constexpr QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr QRect toRect() const noexcept
Returns a QRect based on the values of this rectangle.
\inmodule QtCore\reentrant
\inmodule QtCore \reentrant
The QSequentialIterable class is an iterable interface for a container in a QVariant.
const_iterator constBegin() const noexcept
constexpr QSize toSize() const noexcept
Returns an integer based copy of this size.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString toLower() const &
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QByteArray toUtf8() const &
\inmodule QtCore \reentrant
QString toString(FormattingOptions options=FormattingOptions(PrettyDecoded)) const
Returns a string representation of the URL.
QString toString(StringFormat mode=WithBraces) const
QByteArray toByteArray(StringFormat mode=WithBraces) const
QMap< QString, QString > map
[6]
list append(new Employee("Blackpool", "Stephen"))
QSet< QString >::iterator it
Combined button and popup list for selecting options.
constexpr QBindableInterface iface
Q_CORE_EXPORT bool hasRegisteredConverterFunctionToIterableMetaSequence(QMetaType m)
Q_CORE_EXPORT bool hasRegisteredMutableViewFunctionToIterableMetaSequence(QMetaType m)
Q_CORE_EXPORT bool hasRegisteredConverterFunctionToPairVariantInterface(QMetaType m)
Q_CORE_EXPORT bool hasRegisteredConverterFunctionToIterableMetaAssociation(QMetaType m)
Q_CORE_EXPORT bool hasRegisteredMutableViewFunctionToIterableMetaAssociation(QMetaType m)
void toByteArray(QByteArray &)
static jboolean copy(JNIEnv *, jobject)
size_t qstrlen(const char *str)
QList< QString > QStringList
Constructs a string list that contains the given string, str.
std::pair< QVariant, QVariant > QVariantPair
typedef QByteArray(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC)()
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define Q_GLOBAL_STATIC(TYPE, NAME,...)
constexpr const T & qMax(const T &a, const T &b)
GLint GLfloat GLfloat GLfloat v2
GLsizei const GLfloat * v
[13]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLsizei GLenum GLenum * types
GLenum GLuint GLenum GLsizei length
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLsizei GLchar * source
#define QStringLiteral(str)
unsigned long long quint64
obj metaObject() -> className()
QCborValue(QCborTag(2), QByteArray("\x01\0\0\0\0\0\0\0\0", 9))
[0]
char * toString(const MyType &t)
[31]