9#include <QtCore/qglobal.h>
10#include <QtCore/qatomic.h>
11#include <QtCore/qbytearray.h>
12#include <QtCore/qcompare.h>
13#include <QtCore/qdatastream.h>
14#include <QtCore/qfloat16.h>
15#include <QtCore/qhashfunctions.h>
16#include <QtCore/qiterable.h>
18#include <QtCore/qobjectdefs.h>
20#include <QtCore/qscopeguard.h>
29#include <QtCore/q20type_traits.h>
32#error qmetatype.h must be included before any header file that defines Bool
47#define QT_FOR_EACH_STATIC_PRIMITIVE_NON_VOID_TYPE(F)\
51 F(LongLong, 4, qlonglong) \
52 F(ULongLong, 5, qulonglong) \
53 F(Double, 6, double) \
57 F(Char16, 56, char16_t) \
58 F(Char32, 57, char32_t) \
60 F(UShort, 36, ushort) \
63 F(SChar, 40, signed char) \
64 F(Nullptr, 51, std::nullptr_t) \
65 F(QCborSimpleType, 52, QCborSimpleType) \
67#define QT_FOR_EACH_STATIC_PRIMITIVE_TYPE(F) \
68 QT_FOR_EACH_STATIC_PRIMITIVE_NON_VOID_TYPE(F) \
71#define QT_FOR_EACH_STATIC_PRIMITIVE_POINTER(F) \
72 F(VoidStar, 31, void*) \
74#if QT_CONFIG(easingcurve)
75#define QT_FOR_EACH_STATIC_EASINGCURVE(F)\
76 F(QEasingCurve, 29, QEasingCurve)
78#define QT_FOR_EACH_STATIC_EASINGCURVE(F)
81#if QT_CONFIG(itemmodel)
82#define QT_FOR_EACH_STATIC_ITEMMODEL_CLASS(F)\
83 F(QModelIndex, 42, QModelIndex) \
84 F(QPersistentModelIndex, 50, QPersistentModelIndex)
86#define QT_FOR_EACH_STATIC_ITEMMODEL_CLASS(F)
89#if QT_CONFIG(regularexpression)
90# define QT_FOR_EACH_STATIC_REGULAR_EXPRESSION(F) \
91 F(QRegularExpression, 44, QRegularExpression)
93# define QT_FOR_EACH_STATIC_REGULAR_EXPRESSION(F)
96# define QT_FOR_EACH_STATIC_QVARIANT(F) \
97 F(QVariant, 41, QVariant)
99# define QT_FOR_EACH_STATIC_QVARIANT(F)
102#define QT_FOR_EACH_STATIC_CORE_CLASS(F)\
104 F(QString, 10, QString) \
105 F(QByteArray, 12, QByteArray) \
106 F(QBitArray, 13, QBitArray) \
107 F(QDate, 14, QDate) \
108 F(QTime, 15, QTime) \
109 F(QDateTime, 16, QDateTime) \
111 F(QLocale, 18, QLocale) \
112 F(QRect, 19, QRect) \
113 F(QRectF, 20, QRectF) \
114 F(QSize, 21, QSize) \
115 F(QSizeF, 22, QSizeF) \
116 F(QLine, 23, QLine) \
117 F(QLineF, 24, QLineF) \
118 F(QPoint, 25, QPoint) \
119 F(QPointF, 26, QPointF) \
120 QT_FOR_EACH_STATIC_EASINGCURVE(F) \
121 F(QUuid, 30, QUuid) \
122 QT_FOR_EACH_STATIC_QVARIANT(F) \
123 QT_FOR_EACH_STATIC_REGULAR_EXPRESSION(F) \
124 F(QJsonValue, 45, QJsonValue) \
125 F(QJsonObject, 46, QJsonObject) \
126 F(QJsonArray, 47, QJsonArray) \
127 F(QJsonDocument, 48, QJsonDocument) \
128 F(QCborValue, 53, QCborValue) \
129 F(QCborArray, 54, QCborArray) \
130 F(QCborMap, 55, QCborMap) \
131 F(Float16, 63, qfloat16) \
132 QT_FOR_EACH_STATIC_ITEMMODEL_CLASS(F)
134#define QT_FOR_EACH_STATIC_CORE_POINTER(F)\
135 F(QObjectStar, 39, QObject*)
138# define QT_FOR_EACH_STATIC_CORE_TEMPLATE(F)\
139 F(QVariantMap, 8, QVariantMap) \
140 F(QVariantList, 9, QVariantList) \
141 F(QVariantHash, 28, QVariantHash) \
142 F(QVariantPair, 58, QVariantPair) \
143 F(QByteArrayList, 49, QByteArrayList) \
144 F(QStringList, 11, QStringList) \
147# define QT_FOR_EACH_STATIC_CORE_TEMPLATE(F)\
148 F(QByteArrayList, 49, QByteArrayList) \
149 F(QStringList, 11, QStringList)
152#if QT_CONFIG(shortcut)
153#define QT_FOR_EACH_STATIC_KEYSEQUENCE_CLASS(F)\
154 F(QKeySequence, 0x100b, QKeySequence)
156#define QT_FOR_EACH_STATIC_KEYSEQUENCE_CLASS(F)
159#define QT_FOR_EACH_STATIC_GUI_CLASS(F)\
160 F(QFont, 0x1000, QFont) \
161 F(QPixmap, 0x1001, QPixmap) \
162 F(QBrush, 0x1002, QBrush) \
163 F(QColor, 0x1003, QColor) \
164 F(QPalette, 0x1004, QPalette) \
165 F(QIcon, 0x1005, QIcon) \
166 F(QImage, 0x1006, QImage) \
167 F(QPolygon, 0x1007, QPolygon) \
168 F(QRegion, 0x1008, QRegion) \
169 F(QBitmap, 0x1009, QBitmap) \
170 F(QCursor, 0x100a, QCursor) \
171 QT_FOR_EACH_STATIC_KEYSEQUENCE_CLASS(F) \
172 F(QPen, 0x100c, QPen) \
173 F(QTextLength, 0x100d, QTextLength) \
174 F(QTextFormat, 0x100e, QTextFormat) \
175 F(QTransform, 0x1010, QTransform) \
176 F(QMatrix4x4, 0x1011, QMatrix4x4) \
177 F(QVector2D, 0x1012, QVector2D) \
178 F(QVector3D, 0x1013, QVector3D) \
179 F(QVector4D, 0x1014, QVector4D) \
180 F(QQuaternion, 0x1015, QQuaternion) \
181 F(QPolygonF, 0x1016, QPolygonF) \
182 F(QColorSpace, 0x1017, QColorSpace) \
185#define QT_FOR_EACH_STATIC_WIDGETS_CLASS(F)\
186 F(QSizePolicy, 0x2000, QSizePolicy) \
189#define QT_FOR_EACH_STATIC_ALIAS_TYPE(F)\
190 F(ULong, -1, ulong, "unsigned long") \
191 F(UInt, -1, uint, "unsigned int") \
192 F(UShort, -1, ushort, "unsigned short") \
193 F(UChar, -1, uchar, "unsigned char") \
194 F(LongLong, -1, qlonglong, "long long") \
195 F(ULongLong, -1, qulonglong, "unsigned long long") \
196 F(SChar, -1, signed char, "qint8") \
197 F(UChar, -1, uchar, "quint8") \
198 F(Short, -1, short, "qint16") \
199 F(UShort, -1, ushort, "quint16") \
200 F(Int, -1, int, "qint32") \
201 F(UInt, -1, uint, "quint32") \
202 F(LongLong, -1, qlonglong, "qint64") \
203 F(ULongLong, -1, qulonglong, "quint64") \
204 F(QByteArrayList, -1, QByteArrayList, "QList<QByteArray>") \
205 F(QStringList, -1, QStringList, "QList<QString>") \
206 QT_FOR_EACH_STATIC_VARIANT_ALIAS_TYPE(F)
209#define QT_FOR_EACH_STATIC_VARIANT_ALIAS_TYPE(F) \
210 F(QVariantList, -1, QVariantList, "QList<QVariant>") \
211 F(QVariantMap, -1, QVariantMap, "QMap<QString,QVariant>") \
212 F(QVariantHash, -1, QVariantHash, "QHash<QString,QVariant>") \
213 F(QVariantPair, -1, QVariantPair, "QPair<QVariant,QVariant>") \
216#define QT_FOR_EACH_STATIC_VARIANT_ALIAS_TYPE(F)
219#define QT_FOR_EACH_STATIC_TYPE(F)\
220 QT_FOR_EACH_STATIC_PRIMITIVE_TYPE(F)\
221 QT_FOR_EACH_STATIC_PRIMITIVE_POINTER(F)\
222 QT_FOR_EACH_STATIC_CORE_CLASS(F)\
223 QT_FOR_EACH_STATIC_CORE_POINTER(F)\
224 QT_FOR_EACH_STATIC_CORE_TEMPLATE(F)\
225 QT_FOR_EACH_STATIC_GUI_CLASS(F)\
226 QT_FOR_EACH_STATIC_WIDGETS_CLASS(F)\
228#define QT_DEFINE_METATYPE_ID(TypeName, Id, Name) \
231#define QT_FOR_EACH_AUTOMATIC_TEMPLATE_1ARG(F) \
238#define QT_FOR_EACH_AUTOMATIC_TEMPLATE_2ARG(F) \
242#define QT_FOR_EACH_AUTOMATIC_TEMPLATE_SMART_POINTER(F) \
253class QMetaTypeInterface;
259#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0) || defined(QT_BOOTSTRAPPED) || !defined(Q_CC_MSVC)
263# define QMTI_MUTABLE mutable
316template<
typename From,
typename To>
322 template<
typename T,
bool>
323 struct SequentialValueTypeIsMetaType;
324 template<
typename T,
bool>
326 template<
typename T,
bool>
328 template<
typename,
typename>
334 template<
typename Enum>
349 FirstCoreType = Bool,
355 HighestInternalId = LastWidgetsType,
357 QReal = sizeof(
qreal) == sizeof(
double) ? Double : Float,
365 UnknownType = 0, Bool = 1, Int = 2, UInt = 3, LongLong = 4, ULongLong = 5,
366 Double = 6, Long = 32, Short = 33,
Char = 34, ULong = 35, UShort = 36,
367 UChar = 37, Float = 38,
381 Char16 = 56, Char32 = 57,
382 Int128 = 59, UInt128 = 60, Float128 = 61, BFloat16 = 62,
Float16 = 63,
400 NeedsConstruction = 0x1,
401 NeedsDestruction = 0x2,
402 RelocatableType = 0x4,
403#if QT_DEPRECATED_SINCE(6, 0)
406 PointerToQObject = 0x8,
407 IsEnumeration = 0x10,
408 SharedPointerToQObject = 0x20,
409 WeakPointerToQObject = 0x40,
410 TrackingPointerToQObject = 0x80,
411 IsUnsignedEnumeration = 0x100,
413 PointerToGadget = 0x400,
418 NeedsCopyConstruction = 0x4000,
419 NeedsMoveConstruction = 0x8000,
423 static void registerNormalizedTypedef(
const QT_PREPEND_NAMESPACE(
QByteArray) &normalizedTypeName,
QMetaType type);
425#if QT_DEPRECATED_SINCE(6, 0)
436 static int sizeOf(
int type)
439 static TypeFlags typeFlags(
int type)
448 static void destroy(
int type,
void *
data)
457 static bool isRegistered(
int type);
463 bool isValid()
const;
464 bool isRegistered()
const;
470#if QT_CORE_REMOVED_SINCE(6, 1) || defined(Q_QDOC)
475 int id(
int = 0)
const
478 return registerHelper();
483 constexpr TypeFlags
flags()
const;
485 constexpr const char *
name()
const;
487 void *
create(
const void *
copy =
nullptr)
const;
488 void destroy(
void *
data)
const;
489 void *construct(
void *where,
const void *
copy =
nullptr)
const;
490 void destruct(
void *
data)
const;
492 bool equals(
const void *lhs,
const void *rhs)
const;
498 bool isEqualityComparable()
const;
499 bool isOrdered()
const;
501#ifndef QT_NO_DATASTREAM
504 bool hasRegisteredDataStreamOperators()
const;
506#if QT_DEPRECATED_SINCE(6, 0)
525 if (lhs.d_ptr == rhs.d_ptr)
527 if (!lhs.d_ptr || !rhs.d_ptr)
530 const int aId = lhs.id();
531 const int bId = rhs.id();
535#ifndef QT_NO_DEBUG_STREAM
539 bool debugStream(
QDebug& dbg,
const void *rhs);
540 bool hasRegisteredDebugStreamOperator()
const;
542#if QT_DEPRECATED_SINCE(6, 0)
544 static bool debugStream(
QDebug& dbg,
const void *rhs,
int typeId)
548 static bool hasRegisteredDebugStreamOperator()
549 {
return QMetaType::fromType<T>().hasRegisteredDebugStreamOperator(); }
551 static bool hasRegisteredDebugStreamOperator(
int typeId)
563 template<
typename From,
typename To>
566 return registerConverter<From, To>(QtPrivate::convertImplicit<From, To>);
570 template<
typename From,
typename To>
574 "QMetaType::registerConverter: At least one of the types must be a custom type.");
576 const QMetaType fromType = QMetaType::fromType<From>();
577 const QMetaType toType = QMetaType::fromType<To>();
578 auto converter = [
function](
const void *from,
void *to) ->
bool {
579 const From *
f =
static_cast<const From *
>(from);
580 To *
t =
static_cast<To *
>(to);
584 return registerConverterImpl<From, To>(converter, fromType, toType);
588 template<
typename From,
typename To>
592 "QMetaType::registerMutableView: At least one of the types must be a custom type.");
594 const QMetaType fromType = QMetaType::fromType<From>();
595 const QMetaType toType = QMetaType::fromType<To>();
597 From *
f =
static_cast<From *
>(from);
598 To *
t =
static_cast<To *
>(to);
602 return registerMutableViewImpl<From, To>(
view, fromType, toType);
606 template<
typename From,
typename To>
610 "QMetaType::registerConverter: At least one of the types must be a custom type.");
612 const QMetaType fromType = QMetaType::fromType<From>();
613 const QMetaType toType = QMetaType::fromType<To>();
614 auto converter = [
function](
const void *from,
void *to) ->
bool {
615 const From *
f =
static_cast<const From *
>(from);
616 To *
t =
static_cast<To *
>(to);
623 return registerConverterImpl<From, To>(converter, fromType, toType);
627 template<
typename From,
typename To,
typename UnaryFunction>
631 "QMetaType::registerConverter: At least one of the types must be a custom type.");
633 const QMetaType fromType = QMetaType::fromType<From>();
634 const QMetaType toType = QMetaType::fromType<To>();
635 auto converter = [function = std::move(function)](
const void *from,
void *to) ->
bool {
636 const From *
f =
static_cast<const From *
>(from);
637 To *
t =
static_cast<To *
>(to);
642 *
t = *std::forward<decltype(r)>(
r);
644 *
t = std::forward<decltype(r)>(
r);
648 return registerConverterImpl<From, To>(std::move(converter), fromType, toType);
652 template<
typename From,
typename To,
typename UnaryFunction>
656 "QMetaType::registerMutableView: At least one of the types must be a custom type.");
658 const QMetaType fromType = QMetaType::fromType<From>();
659 const QMetaType toType = QMetaType::fromType<To>();
660 auto view = [function = std::move(function)](
void *from,
void *to) ->
bool {
661 From *
f =
static_cast<From *
>(from);
662 To *
t =
static_cast<To *
>(to);
666 return registerMutableViewImpl<From, To>(std::move(
view), fromType, toType);
670 template<
typename From,
typename To>
671 static bool registerConverterImpl(ConverterFunction converter,
QMetaType fromType,
QMetaType toType)
673 if (registerConverterFunction(std::move(converter), fromType, toType)) {
675 unregisterConverterFunction(fromType, toType);
683 template<
typename From,
typename To>
686 if (registerMutableViewFunction(std::move(
view), fromType, toType)) {
688 unregisterMutableViewFunction(fromType, toType);
702#if QT_DEPRECATED_SINCE(6, 0)
704 static bool convert(
const void *from,
int fromTypeId,
void *to,
int toTypeId)
707 static bool compare(
const void *lhs,
const void *rhs,
int typeId,
int *
result)
710 auto c =
t.compare(lhs, rhs);
726 static bool equals(
const void *lhs,
const void *rhs,
int typeId,
int *
result)
729 if (!
t.isEqualityComparable())
731 *
result =
t.equals(lhs, rhs) ? 0 : -1;
736 template<
typename From,
typename To>
739 return hasRegisteredConverterFunction(
740 QMetaType::fromType<From>(), QMetaType::fromType<To>());
745 template<
typename From,
typename To>
748 return hasRegisteredMutableViewFunction(
749 QMetaType::fromType<From>(), QMetaType::fromType<To>());
768#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
779#if QT_CORE_REMOVED_SINCE(6, 5)
780 int idHelper()
const;
783 int registerHelper()
const
787 if (
int id = d_ptr->typeId.loadRelaxed())
789 return registerHelper(d_ptr);
800#undef QT_DEFINE_METATYPE_ID
804#define QT_METATYPE_PRIVATE_DECLARE_TYPEINFO(C, F) \
806 Q_DECLARE_TYPEINFO(QtMetaTypePrivate:: C, (F)); \
807 namespace QtMetaTypePrivate {
819 typedef void (*getFunc)(
const void *
const *
p,
void *);
826 { *
static_cast<typename T::first_type *
>(dataPtr) =
static_cast<const T*
>(*pair)->first; }
829 { *
static_cast<typename T::second_type *
>(dataPtr) =
static_cast<const T*
>(*pair)->second; }
834 , _metaType_first(
QMetaType::fromType<typename T::first_type>())
835 , _metaType_second(
QMetaType::fromType<typename T::second_type>())
836 , _getFirst(getFirstImpl<T>)
837 , _getSecond(getSecondImpl<T>)
848 inline void first(
void *dataPtr)
const { _getFirst(&_pair, dataPtr); }
849 inline void second(
void *dataPtr)
const { _getSecond(&_pair, dataPtr); }
853template<
typename From>
856template<
typename T,
typename U>
869#define QT_FORWARD_DECLARE_SHARED_POINTER_TYPES_ITER(Name) \
870 template <class T> class Name; \
877 template<
typename T,
typename ODR_VIOLATION_PREVENTER>
881 static auto check(U *) -> std::integral_constant<bool,
sizeof(U) != 0>;
882 static auto check(...) -> std::false_type;
883 using type =
decltype(check(
static_cast<T *
>(
nullptr)));
887 template <
typename T,
typename ODR_VIOLATION_PREVENTER>
895 std::disjunction<std::is_member_pointer<T>,
896 std::is_function<std::remove_pointer_t<T>>>
907 enum { Value =
false };
914 enum { Value =
false };
919 enum { Value =
false };
924 enum { Value =
true };
938 enum { Value =
sizeof(checkType(
static_cast<T*
>(
nullptr))) ==
sizeof(
yes_type) };
941 template<
typename T,
typename Enable =
void>
947 template <
typename X>
951 IsRealGadget =
sizeof(checkType(&T::qt_check_for_QGADGET_macro)) ==
sizeof(
void *),
952 IsGadgetOrDerivedFrom =
true
956 template <
typename T>
957 using IsRealGadget = std::bool_constant<IsGadgetHelper<T>::IsRealGadget>;
959 template<
typename T,
typename Enable =
void>
966 template <
typename X>
989 template<
typename T,
typename Enable =
void>
1003 template<
typename T>
1006 std::bool_constant<IsGadgetHelper<T>::IsGadgetOrDerivedFrom>,
1007 std::is_base_of<QObject, T>
1014 template<
typename T>
1023 template<
typename T>
1031 template<
typename T>
1034 enum { Value =
false };
1037 template<
typename T>
1042 template<
typename T>
1045 enum { Value =
false };
1048 template<
typename T>
1053 template<
typename T>
1056 enum { Value =
false };
1059 template<
typename T>
1062 enum { Value =
true };
1065 template<
typename T>
1068 enum { Value =
false };
1071 template<
typename T>
1074 enum { Value =
false };
1077 template<typename T, bool = QtPrivate::IsSequentialContainer<T>::Value>
1091 template<typename T, bool = QMetaTypeId2<typename T::value_type>::Defined>
1105 template<
typename T>
1110 template<typename T, bool = QtPrivate::IsAssociativeContainer<T>::Value>
1124 template<typename T, bool = QMetaTypeId2<typename T::key_type>::Defined>
1138 template<typename T, bool = QMetaTypeId2<typename T::mapped_type>::Defined>
1152 template<
typename T>
1157 template<typename T, bool = QMetaTypeId2<typename T::first_type>::Defined
1167 template<
typename T>
1170 inline static bool registerConverter();
1173 template<
typename T>
1181 template<
typename T,
typename U>
1184 template<
typename T>
1187 template<
typename T,
typename =
void>
1193#if QT_CONFIG(future)
1194 template<
typename T>
1195 struct MetaTypeQFutureHelper
1197 static bool registerConverter() {
return false; }
1205 "Meta Types must be fully defined");
1206 static_assert(!std::is_reference_v<T>,
1207 "Meta Types cannot be non-const references or rvalue references.");
1209 using Pointed = std::remove_pointer_t<T>;
1211 "Pointer Meta Types must either point to fully-defined types "
1212 "or be declared with Q_DECLARE_OPAQUE_POINTER(T *)");
1220template <
typename T,
int =
1232template <
typename T>
1237template <
typename T>
1245template <
typename T>
1248template <
typename T>
1252 enum { Defined =
false, IsBuiltIn =
false };
1257 template <typename T, bool Defined = QMetaTypeId2<T>::Defined>
1268 template <
typename Result,
typename... Args>
1271 template<
typename T>
1274 template<typename T, bool = std::is_enum<T>::value>
1276 template<
typename T>
1277 constexpr bool IsUnsignedEnum<T, true> = !std::is_signed_v<std::underlying_type_t<T>>;
1279 template<
typename T>
1301 template<
typename T,
bool defined>
1307 template<
typename SmartPo
inter>
1312 return p.operator->();
1318 template <
typename T>
1319 struct EnableInternalDataWrap;
1321 template<
typename T>
1331template <
typename T>
1334#ifndef QT_NO_QOBJECT
1336 "qRegisterNormalizedMetaType",
1337 "qRegisterNormalizedMetaType was called with a not normalized type name, "
1338 "please call qRegisterMetaType instead.");
1341 const QMetaType metaType = QMetaType::fromType<T>();
1342 const int id = metaType.
id();
1350#if QT_CONFIG(future)
1351 QtPrivate::MetaTypeQFutureHelper<T>::registerConverter();
1354 if (normalizedTypeName != metaType.
name())
1370template <
typename T>
1373 return qRegisterNormalizedMetaTypeImplementation<T>(normalizedTypeName);
1376#define QT_DECL_METATYPE_EXTERN_TAGGED(TYPE, TAG, EXPORT) \
1377 QT_BEGIN_NAMESPACE \
1378 EXPORT int qRegisterNormalizedMetaType_ ## TAG (const QByteArray &); \
1379 template <> inline int qRegisterNormalizedMetaType< TYPE >(const QByteArray &name) \
1380 { return qRegisterNormalizedMetaType_ ## TAG (name); } \
1382 Q_DECLARE_METATYPE(TYPE) \
1384#define QT_IMPL_METATYPE_EXTERN_TAGGED(TYPE, TAG) \
1385 int qRegisterNormalizedMetaType_ ## TAG (const QByteArray &name) \
1386 { return qRegisterNormalizedMetaTypeImplementation< TYPE >(name); } \
1388#define QT_DECL_METATYPE_EXTERN(TYPE, EXPORT) \
1389 QT_DECL_METATYPE_EXTERN_TAGGED(TYPE, TYPE, EXPORT)
1390#define QT_IMPL_METATYPE_EXTERN(TYPE) \
1391 QT_IMPL_METATYPE_EXTERN_TAGGED(TYPE, TYPE)
1393template <
typename T>
1401 return qRegisterNormalizedMetaType<T>(normalizedTypeName);
1404template <
typename T>
1413 return QMetaType::fromType<T>().id();
1417template <
typename T>
1420 int id = qMetaTypeId<T>();
1426 return meta.registerHelper();
1429#ifndef QT_NO_QOBJECT
1430template <
typename T>
1440 if (
const int id = metatype_id.loadAcquire())
1442 const char *
const cName = T::staticMetaObject.className();
1444 typeName.reserve(strlen(cName) + 1);
1445 typeName.append(cName).append(
'*');
1446 const int newId = qRegisterNormalizedMetaType<T *>(
typeName);
1447 metatype_id.storeRelease(newId);
1452template <
typename T>
1456 Defined = std::is_default_constructible<T>::value
1462 if (
const int id = metatype_id.loadAcquire())
1464 const char *
const cName = T::staticMetaObject.className();
1465 const int newId = qRegisterNormalizedMetaType<T>(cName);
1466 metatype_id.storeRelease(newId);
1471template <
typename T>
1481 if (
const int id = metatype_id.loadAcquire())
1483 const char *
const cName = T::staticMetaObject.className();
1485 typeName.reserve(strlen(cName) + 1);
1486 typeName.append(cName).append(
'*');
1487 const int newId = qRegisterNormalizedMetaType<T *>(
typeName);
1488 metatype_id.storeRelease(newId);
1493template <
typename T>
1503 if (
const int id = metatype_id.loadAcquire())
1505 const char *eName = qt_getEnumName(T());
1506 const char *cName = qt_getEnumMetaObject(T())->className();
1508 typeName.reserve(strlen(cName) + 2 + strlen(eName));
1509 typeName.append(cName).append(
"::").append(eName);
1510 const int newId = qRegisterNormalizedMetaType<T>(
typeName);
1511 metatype_id.storeRelease(newId);
1517#define Q_DECLARE_OPAQUE_POINTER(POINTER) \
1518 QT_BEGIN_NAMESPACE namespace QtPrivate { \
1519 template <> struct IsPointerDeclaredOpaque<POINTER> \
1520 : std::true_type {}; \
1521 } QT_END_NAMESPACE \
1525#define Q_DECLARE_METATYPE(TYPE) Q_DECLARE_METATYPE_IMPL(TYPE)
1526#define Q_DECLARE_METATYPE_IMPL(TYPE) \
1527 QT_BEGIN_NAMESPACE \
1529 struct QMetaTypeId< TYPE > \
1531 enum { Defined = 1 }; \
1532 static_assert(QtPrivate::checkTypeIsSuitableForMetaType<TYPE>()); \
1533 static int qt_metatype_id() \
1535 Q_CONSTINIT static QBasicAtomicInt metatype_id = Q_BASIC_ATOMIC_INITIALIZER(0); \
1536 if (const int id = metatype_id.loadAcquire()) \
1538 constexpr auto arr = QtPrivate::typenameHelper<TYPE>(); \
1539 auto name = arr.data(); \
1540 if (QByteArrayView(name) == (#TYPE)) { \
1541 const int id = qRegisterNormalizedMetaType<TYPE>(name); \
1542 metatype_id.storeRelease(id); \
1545 const int newId = qRegisterMetaType< TYPE >(#TYPE); \
1546 metatype_id.storeRelease(newId); \
1553#define Q_DECLARE_BUILTIN_METATYPE(TYPE, METATYPEID, NAME) \
1554 QT_BEGIN_NAMESPACE \
1555 template<> struct QMetaTypeId2<NAME> \
1557 using NameAsArrayType = std::array<char, sizeof(#NAME)>; \
1558 enum { Defined = 1, IsBuiltIn = true, MetaType = METATYPEID }; \
1559 static inline constexpr int qt_metatype_id() { return METATYPEID; } \
1560 static constexpr NameAsArrayType nameAsArray = { #NAME }; \
1564#define QT_FORWARD_DECLARE_STATIC_TYPES_ITER(TypeName, TypeId, Name) \
1571#undef QT_FORWARD_DECLARE_STATIC_TYPES_ITER
1573#define Q_DECLARE_METATYPE_TEMPLATE_1ARG(SINGLE_ARG_TEMPLATE) \
1575template <typename T> \
1576struct QMetaTypeId< SINGLE_ARG_TEMPLATE<T> > \
1579 Defined = QMetaTypeId2<T>::Defined \
1581 static int qt_metatype_id() \
1583 Q_CONSTINIT static QBasicAtomicInt metatype_id = Q_BASIC_ATOMIC_INITIALIZER(0); \
1584 if (const int id = metatype_id.loadRelaxed()) \
1586 const char *tName = QMetaType::fromType<T>().name(); \
1588 const size_t tNameLen = qstrlen(tName); \
1589 QByteArray typeName; \
1590 typeName.reserve(sizeof(#SINGLE_ARG_TEMPLATE) + 1 + tNameLen + 1 + 1); \
1591 typeName.append(#SINGLE_ARG_TEMPLATE, int(sizeof(#SINGLE_ARG_TEMPLATE)) - 1) \
1592 .append('<').append(tName, tNameLen); \
1593 typeName.append('>'); \
1594 const int newId = qRegisterNormalizedMetaType< SINGLE_ARG_TEMPLATE<T> >(typeName); \
1595 metatype_id.storeRelease(newId); \
1601#define Q_DECLARE_METATYPE_TEMPLATE_2ARG(DOUBLE_ARG_TEMPLATE) \
1603template<typename T, typename U> \
1604struct QMetaTypeId< DOUBLE_ARG_TEMPLATE<T, U> > \
1607 Defined = QMetaTypeId2<T>::Defined && QMetaTypeId2<U>::Defined \
1609 static int qt_metatype_id() \
1611 Q_CONSTINIT static QBasicAtomicInt metatype_id = Q_BASIC_ATOMIC_INITIALIZER(0); \
1612 if (const int id = metatype_id.loadAcquire()) \
1614 const char *tName = QMetaType::fromType<T>().name(); \
1615 const char *uName = QMetaType::fromType<U>().name(); \
1618 const size_t tNameLen = qstrlen(tName); \
1619 const size_t uNameLen = qstrlen(uName); \
1620 QByteArray typeName; \
1621 typeName.reserve(sizeof(#DOUBLE_ARG_TEMPLATE) + 1 + tNameLen + 1 + uNameLen + 1 + 1); \
1622 typeName.append(#DOUBLE_ARG_TEMPLATE, int(sizeof(#DOUBLE_ARG_TEMPLATE)) - 1) \
1623 .append('<').append(tName, tNameLen).append(',').append(uName, uNameLen); \
1624 typeName.append('>'); \
1625 const int newId = qRegisterNormalizedMetaType< DOUBLE_ARG_TEMPLATE<T, U> >(typeName); \
1626 metatype_id.storeRelease(newId); \
1634template<
typename T,
bool =
false>
1648#define Q_DECLARE_SMART_POINTER_METATYPE(SMART_POINTER) \
1650namespace QtPrivate { \
1651template<typename T> \
1652struct SharedPointerMetaTypeIdHelper<SMART_POINTER<T>, true> \
1657 static int qt_metatype_id() \
1659 Q_CONSTINIT static QBasicAtomicInt metatype_id = Q_BASIC_ATOMIC_INITIALIZER(0); \
1660 if (const int id = metatype_id.loadAcquire()) \
1662 const char * const cName = T::staticMetaObject.className(); \
1663 QByteArray typeName; \
1664 typeName.reserve(sizeof(#SMART_POINTER) + 1 + strlen(cName) + 1); \
1665 typeName.append(#SMART_POINTER, int(sizeof(#SMART_POINTER)) - 1) \
1666 .append('<').append(cName).append('>'); \
1667 const int newId = qRegisterNormalizedMetaType< SMART_POINTER<T> >(typeName); \
1668 metatype_id.storeRelease(newId); \
1672template<typename T> \
1673struct MetaTypeSmartPointerHelper<SMART_POINTER<T> , \
1674 typename std::enable_if<IsPointerToTypeDerivedFromQObject<T*>::Value && !std::is_const_v<T>>::type> \
1676 static bool registerConverter() \
1678 const QMetaType to = QMetaType(QMetaType::QObjectStar); \
1679 if (!QMetaType::hasRegisteredConverterFunction(QMetaType::fromType<SMART_POINTER<T>>(), to)) { \
1680 QtPrivate::QSmartPointerConvertFunctor<SMART_POINTER<T> > o; \
1681 return QMetaType::registerConverter<SMART_POINTER<T>, QObject*>(o); \
1687template <typename T> \
1688struct QMetaTypeId< SMART_POINTER<T> > \
1689 : QtPrivate::SharedPointerMetaTypeIdHelper< SMART_POINTER<T>, \
1690 QtPrivate::IsPointerToTypeDerivedFromQObject<T*>::Value> \
1695#define Q_DECLARE_SEQUENTIAL_CONTAINER_METATYPE(SINGLE_ARG_TEMPLATE) \
1696 QT_BEGIN_NAMESPACE \
1697 namespace QtPrivate { \
1698 template<typename T> \
1699 struct IsSequentialContainer<SINGLE_ARG_TEMPLATE<T> > \
1701 enum { Value = true }; \
1705 Q_DECLARE_METATYPE_TEMPLATE_1ARG(SINGLE_ARG_TEMPLATE)
1707#define Q_DECLARE_SEQUENTIAL_CONTAINER_METATYPE_ITER(TEMPLATENAME) \
1708 Q_DECLARE_SEQUENTIAL_CONTAINER_METATYPE(TEMPLATENAME)
1714#undef Q_DECLARE_SEQUENTIAL_CONTAINER_METATYPE_ITER
1719#define Q_DECLARE_ASSOCIATIVE_CONTAINER_METATYPE(TEMPLATENAME) \
1720 QT_BEGIN_NAMESPACE \
1721 namespace QtPrivate { \
1722 template<typename T, typename U> \
1723 struct IsAssociativeContainer<TEMPLATENAME<T, U> > \
1725 enum { Value = true }; \
1729 Q_DECLARE_METATYPE_TEMPLATE_2ARG(TEMPLATENAME)
1737#define Q_DECLARE_METATYPE_TEMPLATE_SMART_POINTER_ITER(TEMPLATENAME) \
1738 Q_DECLARE_SMART_POINTER_METATYPE(TEMPLATENAME)
1744#undef Q_DECLARE_METATYPE_TEMPLATE_SMART_POINTER_ITER
1755Q_CORE_EXPORT
bool hasRegisteredConverterFunctionToPairVariantInterface(
QMetaType m);
1756Q_CORE_EXPORT
bool hasRegisteredConverterFunctionToIterableMetaSequence(
QMetaType m);
1757Q_CORE_EXPORT
bool hasRegisteredMutableViewFunctionToIterableMetaSequence(
QMetaType m);
1758Q_CORE_EXPORT
bool hasRegisteredConverterFunctionToIterableMetaAssociation(
QMetaType m);
1759Q_CORE_EXPORT
bool hasRegisteredMutableViewFunctionToIterableMetaAssociation(
QMetaType m);
1762template <
typename T>
1767 return QMetaType::registerConverter<T, QtMetaTypePrivate::QPairVariantInterfaceImpl>(
o);
1774template<
typename From>
1779 return QIterable<QMetaSequence>(QMetaSequence::fromContainer<From>(), &
f);
1783template<
typename From>
1788 return QIterable<QMetaSequence>(QMetaSequence::fromContainer<From>(), &
f);
1798 QSequentialIterableConvertFunctor<T>
o;
1799 return QMetaType::registerConverter<T, QIterable<QMetaSequence>>(
o);
1807 QSequentialIterableMutableViewFunctor<T>
o;
1808 return QMetaType::registerMutableView<T, QIterable<QMetaSequence>>(
o);
1814template<
typename From>
1819 return QIterable<QMetaAssociation>(QMetaAssociation::fromContainer<From>(), &
f);
1823template<
typename From>
1828 return QIterable<QMetaAssociation>(QMetaAssociation::fromContainer<From>(), &
f);
1840 QAssociativeIterableConvertFunctor<T>
o;
1841 return QMetaType::registerConverter<T, QIterable<QMetaAssociation>>(
o);
1849 QAssociativeIterableMutableViewFunctor<T>
o;
1850 return QMetaType::registerMutableView<T, QIterable<QMetaAssociation>>(
o);
1865 return ((
s >=
'a' &&
s <=
'z') || (
s >=
'A' &&
s <=
'Z') || (
s >=
'0' &&
s <=
'9')
1868 static constexpr bool is_space(
char s) {
return (
s ==
' ' ||
s ==
'\t' ||
s ==
'\n'); }
1869 static constexpr bool is_number(
char s) {
return s >=
'0' &&
s <=
'9'; }
1870 static constexpr bool starts_with_token(
const char *
b,
const char *e,
const char *
token,
1871 bool msvcKw =
false)
1888 static constexpr bool skipToken(
const char *&
x,
const char *e,
const char *
token,
1889 bool msvcKw =
false)
1891 if (!starts_with_token(
x, e,
token, msvcKw))
1899 static constexpr const char *skipString(
const char *
x,
const char *e)
1903 while (
x != e && *
x != delim) {
1915 static constexpr const char *skipTemplate(
const char *
x,
const char *e,
bool stopAtComa =
false)
1918 int templateDepth = 0;
1926 if (stopAtComa && !scopeDepth && !templateDepth)
1931 if (--templateDepth < 0)
1945 if (is_number(
x[-1]))
1949 x = skipString(
x, e);
1965 constexpr void replaceLast(
char x)
1972 constexpr void appendStr(
const char *
x)
1978 constexpr void normalizeIntegerTypes(
const char *&
begin,
const char *
end)
1982 int numUnsigned = 0;
1987 if (skipToken(
begin,
end,
"long")) {
1991 if (skipToken(
begin,
end,
"int")) {
1995 if (skipToken(
begin,
end,
"short")) {
1999 if (skipToken(
begin,
end,
"unsigned")) {
2003 if (skipToken(
begin,
end,
"signed")) {
2007 if (skipToken(
begin,
end,
"char")) {
2012 if (skipToken(
begin,
end,
"__int64")) {
2021 if (numSigned && numChar)
2022 appendStr(
"signed ");
2023 else if (numUnsigned)
2029 else if (numLong == 1)
2031 else if (numLong == 2)
2032 appendStr(
"longlong");
2033 else if (numUnsigned || numSigned || numInt)
2037 constexpr void skipStructClassOrEnum(
const char *&
begin,
const char *
end)
2041 skipToken(
begin,
end,
"struct",
true) || skipToken(
begin,
end,
"class",
true)
2042 || skipToken(
begin,
end,
"enum",
true);
2045 constexpr void skipQtNamespace(
const char *&
begin,
const char *
end)
2048 const char *nsbeg =
begin;
2049 if (skipToken(nsbeg,
end,
QT_STRINGIFY(QT_NAMESPACE)) && nsbeg + 2 <
end && nsbeg[0] ==
':'
2050 && nsbeg[1] ==
':') {
2062#if defined(Q_CC_CLANG) || defined (Q_CC_GNU)
2066 constexpr int normalizeTypeFromSignature(
const char *
begin,
const char *
end)
2070#if defined (Q_CC_CLANG)
2071 if (
name.find(
"anonymous ") != std::string_view::npos)
2074 if (
name.find(
"unnamed ") != std::string_view::npos)
2077 if (*
begin ==
' ') {
2078 if (last ==
',' || last ==
'>' || last ==
'<' || last ==
'*' || last ==
'&') {
2085 replaceLast(*
begin);
2125 const char *cst =
begin + 1;
2128 bool seenStar =
false;
2129 bool hasMiddleConst =
false;
2131 if (*cst ==
'\"' || (*cst ==
'\'' && !is_number(cst[-1]))) {
2132 cst = skipString(cst,
end);
2139 if (*cst ==
'&' || *cst ==
'*' || *cst ==
'[') {
2140 seenStar = *cst !=
'&' || cst != (
end - 1);
2144 cst = skipTemplate(cst + 1,
end);
2149 const char *skipedCst = cst;
2151 const char *testEnd =
end;
2152 while (skipedCst < testEnd--) {
2153 if (*testEnd ==
'*' || *testEnd ==
'['
2154 || (*testEnd ==
'&' && testEnd != (
end - 1))) {
2158 if (*testEnd ==
'>')
2161 if (adjustConst && !seenStar) {
2162 if (*(
end - 1) ==
'&')
2165 appendStr(
"const ");
2169 hasMiddleConst =
true;
2173 if (skipToken(
begin,
end,
"const")) {
2174 if (adjustConst && !seenStar) {
2175 if (*(
end - 1) ==
'&')
2178 appendStr(
"const ");
2181 if (seenStar && adjustConst) {
2182 const char *e =
end;
2183 if (*(
end - 1) ==
'&' && *(
end - 2) !=
'&')
2187 const char *
token =
"tsnoc";
2200 if (skipToken(
begin,
end,
"QVector")) {
2205 if (skipToken(
begin,
end,
"QPair")) {
2207 appendStr(
"std::pair");
2210 if (!hasMiddleConst)
2214 bool spaceSkiped =
true;
2219 }
else if ((
c ==
'\'' && !is_number(last)) ||
c ==
'\"') {
2228 spaceSkiped =
false;
2232 const char *tpl = skipTemplate(
begin,
end,
true);
2238 }
while (*
begin++ ==
',');
2257template <
typename T1_,
typename T2_>
2263namespace TypeNameHelper {
2265constexpr auto typenameHelper()
2275 t1Name = typenameHelper<T1>();
2280 t2Name = typenameHelper<T2>();
2282 constexpr auto nonTypeDependentLen =
sizeof(
"std::pair<,>");
2283 constexpr auto t1Len = t1Name.size() - 1;
2284 constexpr auto t2Len = t2Name.size() - 1;
2285 constexpr auto length = nonTypeDependentLen + t1Len + t2Len;
2286 std::array<char, length + 1>
result {};
2287 constexpr auto prefix =
"std::pair<";
2288 int currentLength = 0;
2289 for (; currentLength < int(
sizeof(
"std::pair<") - 1); ++currentLength)
2290 result[currentLength] = prefix[currentLength];
2291 for (
int i = 0;
i < int(t1Len); ++currentLength, ++
i)
2292 result[currentLength] = t1Name[
i];
2293 result[currentLength++] =
',';
2294 for (
int i = 0;
i < int(t2Len); ++currentLength, ++
i)
2295 result[currentLength] = t2Name[
i];
2296 result[currentLength++] =
'>';
2297 result[currentLength++] =
'\0';
2300 constexpr auto prefix =
sizeof(
2304#if defined(Q_CC_MSVC) && defined(Q_CC_CLANG)
2305 "auto __cdecl QtPrivate::TypeNameHelper::typenameHelper(void) [T = "
2306#elif defined(Q_CC_MSVC)
2307 "auto __cdecl QtPrivate::TypeNameHelper::typenameHelper<"
2308#elif defined(Q_CC_CLANG)
2309 "auto QtPrivate::TypeNameHelper::typenameHelper() [T = "
2310#elif defined(Q_CC_GHS)
2311 "auto QtPrivate::TypeNameHelper::typenameHelper<T>()[with T="
2313 "constexpr auto QtPrivate::TypeNameHelper::typenameHelper() [with T = "
2316#if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
2317 constexpr int suffix =
sizeof(
">(void)");
2319 constexpr int suffix =
sizeof(
"]");
2322#if defined(Q_CC_GNU_ONLY) && Q_CC_GNU_ONLY < 804
2330 constexpr const char *
begin =
func + prefix;
2334 std::array<char, len + 1>
result {};
2340using TypeNameHelper::typenameHelper;
2342template<
typename T,
typename =
void>
2348 : std::integral_constant<int, QMetaTypeId2<T>::MetaType>
2352template<
typename T,
bool = (QTypeTraits::has_operator_equal_v<T> && !std::is_po
inter_v<T>)>
2358 {
return *
reinterpret_cast<const T *
>(
a) == *
reinterpret_cast<const T *
>(
b); }
2368template<
typename T,
bool = (QTypeTraits::has_operator_less_than_v<T> && !std::is_po
inter_v<T>)>
2372 {
return *
reinterpret_cast<const T *
>(
a) < *
reinterpret_cast<const T *
>(
b); }
2381template<
typename T,
bool = (QTypeTraits::has_ostream_operator_v<QDebug, T> && !std::is_po
inter_v<T>)>
2385 { dbg << *reinterpret_cast<const T *>(
a); }
2394template<
typename T,
bool = QTypeTraits::has_stream_operator_v<QDataStream, T>>
2401#ifndef QT_NO_DATASTREAM
2406 { ds << *reinterpret_cast<const T *>(
a); }
2408 { ds >> *
reinterpret_cast<T *
>(
a); }
2422#if !defined(Q_OS_WIN) && defined(Q_CC_CLANG)
2423# pragma GCC visibility push(hidden)
2430 static constexpr decltype(typenameHelper<S>())
name = typenameHelper<S>();
2444 if constexpr (std::is_copy_constructible_v<S> && !std::is_trivially_copy_constructible_v<S>) {
2446 new (
addr) S(*
reinterpret_cast<const S *
>(
other));
2455 if constexpr (std::is_move_constructible_v<S> && !std::is_trivially_move_constructible_v<S>) {
2457 new (
addr) S(std::move(*
reinterpret_cast<S *
>(
other)));
2466 if constexpr (std::is_destructible_v<S> && !std::is_trivially_destructible_v<S>)
2468 reinterpret_cast<S *
>(
addr)->~S();
2500 using InterfaceType = std::conditional_t<IsConstMetaTypeInterface, const QMetaTypeInterface, NonConstMetaTypeInterface>;
2503 QMetaTypeInterface::CurrentRevision,
2523#if !defined(Q_OS_WIN) && defined(Q_CC_CLANG)
2524# pragma GCC visibility pop
2563#if !defined(QT_BOOTSTRAPPED) && !defined(Q_CC_MSVC) && !defined(Q_OS_INTEGRITY)
2565#ifdef QT_NO_DATA_RELOCATION
2566# define QT_METATYPE_DECLARE_EXTERN_TEMPLATE_ITER(TypeName, Id, Name) \
2567 extern template class Q_CORE_EXPORT QMetaTypeForType<Name>;
2569# define QT_METATYPE_DECLARE_EXTERN_TEMPLATE_ITER(TypeName, Id, Name) \
2570 extern template class Q_CORE_EXPORT QMetaTypeForType<Name>; \
2571 extern template struct Q_CORE_EXPORT QMetaTypeInterfaceWrapper<Name>;
2579#undef QT_METATYPE_DECLARE_EXTERN_TEMPLATE_ITER
2585 using type = std::remove_pointer_t<T>;
2588#define Q_REMOVE_POINTER_LIKE_IMPL(Pointer) \
2589template <typename T> \
2590struct qRemovePointerLike<Pointer<T>> \
2598#undef Q_REMOVE_POINTER_LIKE_IMPL
2600template<
typename T,
typename ForceComplete_>
2615template<
typename Unique,
typename TypeCompletePair>
2618 using T =
typename TypeCompletePair::type;
2619 using ForceComplete =
typename TypeCompletePair::ForceComplete;
2621 using Tz = qRemovePointerLike_t<Ty>;
2623 if constexpr (std::is_void_v<Tz>) {
2626 }
else if constexpr (ForceComplete::value) {
2627 checkTypeIsSuitableForMetaType<Ty>();
2629 }
else if constexpr (std::is_reference_v<Tz>) {
2644 QtPrivate::checkTypeIsSuitableForMetaType<T>();
2645 return QMetaType(QtPrivate::qMetaTypeInterfaceForType<T>());
2650 return d_ptr ? d_ptr->size : 0;
2655 return d_ptr ? d_ptr->alignment : 0;
2660 return d_ptr ? TypeFlags(d_ptr->flags) : TypeFlags{};
2665 return d_ptr && d_ptr->metaObjectFn ? d_ptr->metaObjectFn(d_ptr) :
nullptr;
2668template<
typename... T>
2677 QtPrivate::qTryMetaTypeInterfaceForType<void, QtPrivate::TypeAndForceComplete<T, std::true_type>>()...
2682 return d_ptr ? d_ptr->name :
nullptr;
2685template<
typename Unique,
typename... T>
2687 QtPrivate::qTryMetaTypeInterfaceForType<Unique, T>()...
2700 QPairVariantInterfaceImpl, Q_CORE_EXPORT)
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
The QColorSpace class provides a color space abstraction.
The QColor class provides colors based on RGB, HSV or CMYK values.
The QCursor class provides a mouse cursor with an arbitrary shape.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\inmodule QtCore \reentrant
The QIcon class provides scalable icons in different modes and states.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
The QKeySequence class encapsulates a key sequence as used by shortcuts.
\inmodule QtCore\compares equality \compareswith equality QLine \endcompareswith
\inmodule QtCore\compares equality \compareswith equality QLineF \endcompareswith
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
The QPalette class contains color groups for each widget state.
\variable Qt::partial_ordering::less
static const QPartialOrdering Less
static const QPartialOrdering Equivalent
static const QPartialOrdering Unordered
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
The QPolygonF class provides a list of points using floating point precision.
The QPolygon class provides a list of points using integer precision.
The QQuaternion class represents a quaternion consisting of a vector and scalar.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
The QRegion class specifies a clip region for a painter.
\inmodule QtCore \reentrant
The QSizePolicy class is a layout attribute describing horizontal and vertical resizing policy.
\macro QT_RESTRICTED_CAST_FROM_ASCII
\inmodule QtCore \reentrant
The QVector2D class represents a vector or vertex in 2D space.
The QVector3D class represents a vector or vertex in 3D space.
The QVector4D class represents a vector or vertex in 4D space.
list append(new Employee("Blackpool", "Stephen"))
bool isBuiltinType(const QByteArray &type)
static QByteArray normalizeType(const QByteArray &ba)
Combined button and popup list for selecting options.
bool canConvert(const QQmlPropertyCache *fromMo, const QQmlPropertyCache *toMo)
Q_CORE_EXPORT bool hasRegisteredConverterFunctionToIterableMetaSequence(QMetaType m)
Q_CORE_EXPORT bool hasRegisteredMutableViewFunctionToIterableMetaSequence(QMetaType m)
static constexpr bool checkTypeIsSuitableForMetaType()
constexpr bool IsQmlListType
typename qRemovePointerLike< T >::type qRemovePointerLike_t
constexpr bool IsUnsignedEnum
Q_CORE_EXPORT bool hasRegisteredConverterFunctionToPairVariantInterface(QMetaType m)
constexpr const QMetaTypeInterface * qTryMetaTypeInterfaceForType()
std::bool_constant< IsGadgetHelper< T >::IsRealGadget > IsRealGadget
Q_CORE_EXPORT bool hasRegisteredConverterFunctionToIterableMetaAssociation(QMetaType m)
Q_CORE_EXPORT bool hasRegisteredMutableViewFunctionToIterableMetaAssociation(QMetaType m)
To convertImplicit(const From &from)
This template is used for implicit conversion from type From to type To.
constexpr const QMetaTypeInterface * qMetaTypeInterfaceForType()
char qt_getEnumMetaObject(const T &)
std::remove_cv_t< std::remove_reference_t< T > > remove_cvref_t
static jboolean copy(JNIEnv *, jobject)
#define Q_BASIC_ATOMIC_INITIALIZER(a)
#define Q_DECLARE_EQUALITY_COMPARABLE(...)
#define Q_DECL_ENUMERATOR_DEPRECATED_X(x)
#define Q_DECL_PURE_FUNCTION
#define QT_WARNING_DISABLE_FLOAT_COMPARE
std::pair< QVariant, QVariant > QVariantPair
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction function
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
size_t qHash(const QFileSystemWatcherPathKey &key, size_t seed=0)
#define Q_DECLARE_FLAGS(Flags, Enum)
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
GLboolean GLboolean GLboolean b
GLint GLint GLint GLint GLint x
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLenum GLsizei length
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
#define Q_ASSERT_X(cond, x, msg)
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
QScopeGuard< typename std::decay< F >::type > qScopeGuard(F &&f)
[qScopeGuard]
#define QT_DEPRECATED_VERSION_6_0
static int compare(quint64 a, quint64 b)
QT_BEGIN_NAMESPACE typedef signed char qint8
static bool lessThan(const QChar *a, int l, const char *c)
QT_BEGIN_NAMESPACE typedef uchar * output
obj metaObject() -> className()
static T * internalData(const QWeakPointer< T > &p) noexcept
static void * checkType(void(T::*)())
static char checkType(void(X::*)())
static bool registerConverter()
static char checkType(void(X::*)())
static void * checkType(void(T::*)())
static no_type checkType(...)
static yes_type checkType(QObject *)
static yes_type checkType(const QObject *)
static const T & declval()
QIterable< QMetaAssociation > operator()(const From &f) const
QIterable< QMetaAssociation > operator()(From &f) const
static void dataStreamIn(const QMetaTypeInterface *, QDataStream &ds, void *a)
static void dataStreamOut(const QMetaTypeInterface *, QDataStream &ds, const void *a)
static void debugStream(const QMetaTypeInterface *, QDebug &dbg, const void *a)
QT_WARNING_PUSH static QT_WARNING_DISABLE_FLOAT_COMPARE bool equals(const QMetaTypeInterface *, const void *a, const void *b)
static bool lessThan(const QMetaTypeInterface *, const void *a, const void *b)
QIterable< QMetaSequence > operator()(const From &f) const
QIterable< QMetaSequence > operator()(From &f) const
QObject * operator()(const QWeakPointer< T > &p) const
QObject * operator()(const SmartPointer &p) const
constexpr int normalizeType(const char *begin, const char *end, bool adjustConst=true)
constexpr int normalizeTypeFromSignature(const char *begin, const char *end)
ForceComplete_ ForceComplete
static auto check(...) -> std::false_type
static auto check(U *) -> std::integral_constant< bool, sizeof(U) !=0 >
decltype(check(static_cast< T * >(nullptr))) type
std::remove_pointer_t< T > type