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>
21#include <QtCore/qttypetraits.h>
30#include <QtCore/q20type_traits.h>
33#error qmetatype.h must be included before any header file that defines Bool
48#define QT_FOR_EACH_STATIC_PRIMITIVE_NON_VOID_TYPE(F)\
52 F(LongLong, 4, qlonglong) \
53 F(ULongLong, 5, qulonglong) \
54 F(Double, 6, double) \
58 F(Char16, 56, char16_t) \
59 F(Char32, 57, char32_t) \
61 F(UShort, 36, ushort) \
64 F(SChar, 40, signed char) \
65 F(Nullptr, 51, std::nullptr_t) \
66 F(QCborSimpleType, 52, QCborSimpleType) \
68#define QT_FOR_EACH_STATIC_PRIMITIVE_TYPE(F) \
69 QT_FOR_EACH_STATIC_PRIMITIVE_NON_VOID_TYPE(F) \
72#define QT_FOR_EACH_STATIC_PRIMITIVE_POINTER(F) \
73 F(VoidStar, 31, void*) \
75#if QT_CONFIG(easingcurve)
76#define QT_FOR_EACH_STATIC_EASINGCURVE(F)\
77 F(QEasingCurve, 29, QEasingCurve)
79#define QT_FOR_EACH_STATIC_EASINGCURVE(F)
82#if QT_CONFIG(itemmodel)
83#define QT_FOR_EACH_STATIC_ITEMMODEL_CLASS(F)\
84 F(QModelIndex, 42, QModelIndex) \
85 F(QPersistentModelIndex, 50, QPersistentModelIndex)
87#define QT_FOR_EACH_STATIC_ITEMMODEL_CLASS(F)
90#if QT_CONFIG(regularexpression)
91# define QT_FOR_EACH_STATIC_REGULAR_EXPRESSION(F) \
92 F(QRegularExpression, 44, QRegularExpression)
94# define QT_FOR_EACH_STATIC_REGULAR_EXPRESSION(F)
97# define QT_FOR_EACH_STATIC_QVARIANT(F) \
98 F(QVariant, 41, QVariant)
100# define QT_FOR_EACH_STATIC_QVARIANT(F)
103#define QT_FOR_EACH_STATIC_CORE_CLASS(F)\
105 F(QString, 10, QString) \
106 F(QByteArray, 12, QByteArray) \
107 F(QBitArray, 13, QBitArray) \
108 F(QDate, 14, QDate) \
109 F(QTime, 15, QTime) \
110 F(QDateTime, 16, QDateTime) \
112 F(QLocale, 18, QLocale) \
113 F(QRect, 19, QRect) \
114 F(QRectF, 20, QRectF) \
115 F(QSize, 21, QSize) \
116 F(QSizeF, 22, QSizeF) \
117 F(QLine, 23, QLine) \
118 F(QLineF, 24, QLineF) \
119 F(QPoint, 25, QPoint) \
120 F(QPointF, 26, QPointF) \
121 QT_FOR_EACH_STATIC_EASINGCURVE(F) \
122 F(QUuid, 30, QUuid) \
123 QT_FOR_EACH_STATIC_QVARIANT(F) \
124 QT_FOR_EACH_STATIC_REGULAR_EXPRESSION(F) \
125 F(QJsonValue, 45, QJsonValue) \
126 F(QJsonObject, 46, QJsonObject) \
127 F(QJsonArray, 47, QJsonArray) \
128 F(QJsonDocument, 48, QJsonDocument) \
129 F(QCborValue, 53, QCborValue) \
130 F(QCborArray, 54, QCborArray) \
131 F(QCborMap, 55, QCborMap) \
132 F(Float16, 63, qfloat16) \
133 QT_FOR_EACH_STATIC_ITEMMODEL_CLASS(F)
135#define QT_FOR_EACH_STATIC_CORE_POINTER(F)\
136 F(QObjectStar, 39, QObject*)
139# define QT_FOR_EACH_STATIC_CORE_TEMPLATE(F)\
140 F(QVariantMap, 8, QVariantMap) \
141 F(QVariantList, 9, QVariantList) \
142 F(QVariantHash, 28, QVariantHash) \
143 F(QVariantPair, 58, QVariantPair) \
144 F(QByteArrayList, 49, QByteArrayList) \
145 F(QStringList, 11, QStringList) \
148# define QT_FOR_EACH_STATIC_CORE_TEMPLATE(F)\
149 F(QByteArrayList, 49, QByteArrayList) \
150 F(QStringList, 11, QStringList)
153#if QT_CONFIG(shortcut)
154#define QT_FOR_EACH_STATIC_KEYSEQUENCE_CLASS(F)\
155 F(QKeySequence, 0x100b, QKeySequence)
157#define QT_FOR_EACH_STATIC_KEYSEQUENCE_CLASS(F)
160#define QT_FOR_EACH_STATIC_GUI_CLASS(F)\
161 F(QFont, 0x1000, QFont) \
162 F(QPixmap, 0x1001, QPixmap) \
163 F(QBrush, 0x1002, QBrush) \
164 F(QColor, 0x1003, QColor) \
165 F(QPalette, 0x1004, QPalette) \
166 F(QIcon, 0x1005, QIcon) \
167 F(QImage, 0x1006, QImage) \
168 F(QPolygon, 0x1007, QPolygon) \
169 F(QRegion, 0x1008, QRegion) \
170 F(QBitmap, 0x1009, QBitmap) \
171 F(QCursor, 0x100a, QCursor) \
172 QT_FOR_EACH_STATIC_KEYSEQUENCE_CLASS(F) \
173 F(QPen, 0x100c, QPen) \
174 F(QTextLength, 0x100d, QTextLength) \
175 F(QTextFormat, 0x100e, QTextFormat) \
176 F(QTransform, 0x1010, QTransform) \
177 F(QMatrix4x4, 0x1011, QMatrix4x4) \
178 F(QVector2D, 0x1012, QVector2D) \
179 F(QVector3D, 0x1013, QVector3D) \
180 F(QVector4D, 0x1014, QVector4D) \
181 F(QQuaternion, 0x1015, QQuaternion) \
182 F(QPolygonF, 0x1016, QPolygonF) \
183 F(QColorSpace, 0x1017, QColorSpace) \
186#define QT_FOR_EACH_STATIC_WIDGETS_CLASS(F)\
187 F(QSizePolicy, 0x2000, QSizePolicy) \
190#define QT_FOR_EACH_STATIC_ALIAS_TYPE(F)\
191 F(ULong, -1, ulong, "unsigned long") \
192 F(UInt, -1, uint, "unsigned int") \
193 F(UShort, -1, ushort, "unsigned short") \
194 F(UChar, -1, uchar, "unsigned char") \
195 F(LongLong, -1, qlonglong, "long long") \
196 F(ULongLong, -1, qulonglong, "unsigned long long") \
197 F(SChar, -1, signed char, "qint8") \
198 F(UChar, -1, uchar, "quint8") \
199 F(Short, -1, short, "qint16") \
200 F(UShort, -1, ushort, "quint16") \
201 F(Int, -1, int, "qint32") \
202 F(UInt, -1, uint, "quint32") \
203 F(LongLong, -1, qlonglong, "qint64") \
204 F(ULongLong, -1, qulonglong, "quint64") \
205 F(QByteArrayList, -1, QByteArrayList, "QList<QByteArray>") \
206 F(QStringList, -1, QStringList, "QList<QString>") \
207 QT_FOR_EACH_STATIC_VARIANT_ALIAS_TYPE(F)
210#define QT_FOR_EACH_STATIC_VARIANT_ALIAS_TYPE(F) \
211 F(QVariantList, -1, QVariantList, "QList<QVariant>") \
212 F(QVariantMap, -1, QVariantMap, "QMap<QString,QVariant>") \
213 F(QVariantHash, -1, QVariantHash, "QHash<QString,QVariant>") \
214 F(QVariantPair, -1, QVariantPair, "QPair<QVariant,QVariant>") \
217#define QT_FOR_EACH_STATIC_VARIANT_ALIAS_TYPE(F)
220#define QT_FOR_EACH_STATIC_TYPE(F)\
221 QT_FOR_EACH_STATIC_PRIMITIVE_TYPE(F)\
222 QT_FOR_EACH_STATIC_PRIMITIVE_POINTER(F)\
223 QT_FOR_EACH_STATIC_CORE_CLASS(F)\
224 QT_FOR_EACH_STATIC_CORE_POINTER(F)\
225 QT_FOR_EACH_STATIC_CORE_TEMPLATE(F)\
226 QT_FOR_EACH_STATIC_GUI_CLASS(F)\
227 QT_FOR_EACH_STATIC_WIDGETS_CLASS(F)\
229#define QT_DEFINE_METATYPE_ID(TypeName, Id, Name) \
232#define QT_FOR_EACH_AUTOMATIC_TEMPLATE_1ARG(F) \
239#define QT_FOR_EACH_AUTOMATIC_TEMPLATE_2ARG(F) \
243#define QT_FOR_EACH_AUTOMATIC_TEMPLATE_SMART_POINTER(F) \
254class QMetaTypeInterface;
260#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0) || defined(QT_BOOTSTRAPPED) || !defined(Q_CC_MSVC)
264# define QMTI_MUTABLE mutable
317template<
typename From,
typename To>
323 template<
typename T,
bool>
324 struct SequentialValueTypeIsMetaType;
325 template<
typename T,
bool>
327 template<
typename T,
bool>
329 template<
typename,
typename>
335 template<
typename Enum>
350 FirstCoreType = Bool,
356 HighestInternalId = LastWidgetsType,
366 UnknownType = 0, Bool = 1,
Int = 2, UInt = 3, LongLong = 4, ULongLong = 5,
367 Double = 6,
Long = 32, Short = 33,
Char = 34, ULong = 35, UShort = 36,
368 UChar = 37,
Float = 38,
382 Char16 = 56, Char32 = 57,
383 Int128 = 59, UInt128 = 60, Float128 = 61, BFloat16 = 62,
Float16 = 63,
401 NeedsConstruction = 0x1,
402 NeedsDestruction = 0x2,
403 RelocatableType = 0x4,
404#if QT_DEPRECATED_SINCE(6, 0)
407 PointerToQObject = 0x8,
408 IsEnumeration = 0x10,
409 SharedPointerToQObject = 0x20,
410 WeakPointerToQObject = 0x40,
411 TrackingPointerToQObject = 0x80,
412 IsUnsignedEnumeration = 0x100,
414 PointerToGadget = 0x400,
419 NeedsCopyConstruction = 0x4000,
420 NeedsMoveConstruction = 0x8000,
424 static void registerNormalizedTypedef(
const QT_PREPEND_NAMESPACE(
QByteArray) &normalizedTypeName,
QMetaType type);
426#if QT_DEPRECATED_SINCE(6, 0)
437 static int sizeOf(
int type)
440 static TypeFlags typeFlags(
int type)
449 static void destroy(
int type,
void *
data)
458 static bool isRegistered(
int type);
464 bool isValid()
const;
465 bool isRegistered()
const;
471#if QT_CORE_REMOVED_SINCE(6, 1) || defined(Q_QDOC)
476 int id(
int = 0)
const
479 return registerHelper();
484 constexpr TypeFlags
flags()
const;
486 constexpr const char *
name()
const;
488 void *
create(
const void *
copy =
nullptr)
const;
489 void destroy(
void *
data)
const;
490 void *construct(
void *where,
const void *
copy =
nullptr)
const;
491 void destruct(
void *
data)
const;
493 bool equals(
const void *lhs,
const void *rhs)
const;
499 bool isEqualityComparable()
const;
500 bool isOrdered()
const;
502#ifndef QT_NO_DATASTREAM
505 bool hasRegisteredDataStreamOperators()
const;
507#if QT_DEPRECATED_SINCE(6, 0)
526 if (lhs.d_ptr == rhs.d_ptr)
528 if (!lhs.d_ptr || !rhs.d_ptr)
531 const int aId = lhs.id();
532 const int bId = rhs.id();
536#ifndef QT_NO_DEBUG_STREAM
540 bool debugStream(
QDebug& dbg,
const void *rhs);
541 bool hasRegisteredDebugStreamOperator()
const;
543#if QT_DEPRECATED_SINCE(6, 0)
545 static bool debugStream(
QDebug& dbg,
const void *rhs,
int typeId)
549 static bool hasRegisteredDebugStreamOperator()
550 {
return QMetaType::fromType<T>().hasRegisteredDebugStreamOperator(); }
552 static bool hasRegisteredDebugStreamOperator(
int typeId)
564 template<
typename From,
typename To>
567 return registerConverter<From, To>(QtPrivate::convertImplicit<From, To>);
571 template<
typename From,
typename To>
575 "QMetaType::registerConverter: At least one of the types must be a custom type.");
577 const QMetaType fromType = QMetaType::fromType<From>();
578 const QMetaType toType = QMetaType::fromType<To>();
579 auto converter = [
function](
const void *from,
void *to) ->
bool {
580 const From *
f =
static_cast<const From *
>(from);
581 To *
t =
static_cast<To *
>(to);
585 return registerConverterImpl<From, To>(converter, fromType, toType);
589 template<
typename From,
typename To>
593 "QMetaType::registerMutableView: At least one of the types must be a custom type.");
595 const QMetaType fromType = QMetaType::fromType<From>();
596 const QMetaType toType = QMetaType::fromType<To>();
598 From *
f =
static_cast<From *
>(from);
599 To *
t =
static_cast<To *
>(to);
603 return registerMutableViewImpl<From, To>(
view, fromType, toType);
607 template<
typename From,
typename To>
611 "QMetaType::registerConverter: At least one of the types must be a custom type.");
613 const QMetaType fromType = QMetaType::fromType<From>();
614 const QMetaType toType = QMetaType::fromType<To>();
615 auto converter = [
function](
const void *from,
void *to) ->
bool {
616 const From *
f =
static_cast<const From *
>(from);
617 To *
t =
static_cast<To *
>(to);
624 return registerConverterImpl<From, To>(converter, fromType, toType);
628 template<
typename From,
typename To,
typename UnaryFunction>
632 "QMetaType::registerConverter: At least one of the types must be a custom type.");
634 const QMetaType fromType = QMetaType::fromType<From>();
635 const QMetaType toType = QMetaType::fromType<To>();
636 auto converter = [function = std::move(function)](
const void *from,
void *to) ->
bool {
637 const From *
f =
static_cast<const From *
>(from);
638 To *
t =
static_cast<To *
>(to);
643 *
t = *std::forward<decltype(r)>(
r);
645 *
t = std::forward<decltype(r)>(
r);
649 return registerConverterImpl<From, To>(std::move(converter), fromType, toType);
653 template<
typename From,
typename To,
typename UnaryFunction>
657 "QMetaType::registerMutableView: At least one of the types must be a custom type.");
659 const QMetaType fromType = QMetaType::fromType<From>();
660 const QMetaType toType = QMetaType::fromType<To>();
661 auto view = [function = std::move(function)](
void *from,
void *to) ->
bool {
662 From *
f =
static_cast<From *
>(from);
663 To *
t =
static_cast<To *
>(to);
667 return registerMutableViewImpl<From, To>(std::move(
view), fromType, toType);
671 template<
typename From,
typename To>
672 static bool registerConverterImpl(ConverterFunction converter,
QMetaType fromType,
QMetaType toType)
674 if (registerConverterFunction(std::move(converter), fromType, toType)) {
676 unregisterConverterFunction(fromType, toType);
684 template<
typename From,
typename To>
687 if (registerMutableViewFunction(std::move(
view), fromType, toType)) {
689 unregisterMutableViewFunction(fromType, toType);
703#if QT_DEPRECATED_SINCE(6, 0)
705 static bool convert(
const void *from,
int fromTypeId,
void *to,
int toTypeId)
708 static bool compare(
const void *lhs,
const void *rhs,
int typeId,
int *
result)
711 auto c =
t.compare(lhs, rhs);
727 static bool equals(
const void *lhs,
const void *rhs,
int typeId,
int *
result)
730 if (!
t.isEqualityComparable())
732 *
result =
t.equals(lhs, rhs) ? 0 : -1;
737 template<
typename From,
typename To>
740 return hasRegisteredConverterFunction(
741 QMetaType::fromType<From>(), QMetaType::fromType<To>());
746 template<
typename From,
typename To>
749 return hasRegisteredMutableViewFunction(
750 QMetaType::fromType<From>(), QMetaType::fromType<To>());
769#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
780#if QT_CORE_REMOVED_SINCE(6, 5)
781 int idHelper()
const;
784 int registerHelper()
const
788 if (
int id = d_ptr->typeId.loadRelaxed())
790 return registerHelper(d_ptr);
801#undef QT_DEFINE_METATYPE_ID
805#define QT_METATYPE_PRIVATE_DECLARE_TYPEINFO(C, F) \
807 Q_DECLARE_TYPEINFO(QtMetaTypePrivate:: C, (F)); \
808 namespace QtMetaTypePrivate {
820 typedef void (*getFunc)(
const void *
const *
p,
void *);
827 { *
static_cast<typename T::first_type *
>(dataPtr) =
static_cast<const T*
>(*pair)->first; }
830 { *
static_cast<typename T::second_type *
>(dataPtr) =
static_cast<const T*
>(*pair)->second; }
835 , _metaType_first(
QMetaType::fromType<typename T::first_type>())
836 , _metaType_second(
QMetaType::fromType<typename T::second_type>())
837 , _getFirst(getFirstImpl<T>)
838 , _getSecond(getSecondImpl<T>)
849 inline void first(
void *dataPtr)
const { _getFirst(&_pair, dataPtr); }
850 inline void second(
void *dataPtr)
const { _getSecond(&_pair, dataPtr); }
854template<
typename From>
857template<
typename T,
typename U>
870#define QT_FORWARD_DECLARE_SHARED_POINTER_TYPES_ITER(Name) \
871 template <class T> class Name; \
878 template<
typename T,
typename ODR_VIOLATION_PREVENTER>
882 static auto check(U *) -> std::integral_constant<bool,
sizeof(U) != 0>;
883 static auto check(...) -> std::false_type;
884 using type =
decltype(check(
static_cast<T *
>(
nullptr)));
888 template <
typename T,
typename ODR_VIOLATION_PREVENTER>
896 std::disjunction<std::is_member_pointer<T>,
897 std::is_function<std::remove_pointer_t<T>>>
908 enum { Value =
false };
915 enum { Value =
false };
920 enum { Value =
false };
925 enum { Value =
true };
939 enum { Value =
sizeof(checkType(
static_cast<T*
>(
nullptr))) ==
sizeof(
yes_type) };
942 template<
typename T,
typename Enable =
void>
948 template <
typename X>
952 IsRealGadget =
sizeof(checkType(&T::qt_check_for_QGADGET_macro)) ==
sizeof(
void *),
953 IsGadgetOrDerivedFrom =
true
957 template <
typename T>
958 using IsRealGadget = std::bool_constant<IsGadgetHelper<T>::IsRealGadget>;
960 template<
typename T,
typename Enable =
void>
967 template <
typename X>
990 template<
typename T,
typename Enable =
void>
1004 template<
typename T>
1007 std::bool_constant<IsGadgetHelper<T>::IsGadgetOrDerivedFrom>,
1008 std::is_base_of<QObject, T>
1015 template<
typename T>
1024 template<
typename T>
1032 template<
typename T>
1035 enum { Value =
false };
1038 template<
typename T>
1043 template<
typename T>
1046 enum { Value =
false };
1049 template<
typename T>
1054 template<
typename T>
1057 enum { Value =
false };
1060 template<
typename T>
1063 enum { Value =
true };
1066 template<
typename T>
1069 enum { Value =
false };
1072 template<
typename T>
1075 enum { Value =
false };
1078 template<typename T, bool = QtPrivate::IsSequentialContainer<T>::Value>
1092 template<typename T, bool = QMetaTypeId2<typename T::value_type>::Defined>
1106 template<
typename T>
1111 template<typename T, bool = QtPrivate::IsAssociativeContainer<T>::Value>
1125 template<typename T, bool = QMetaTypeId2<typename T::key_type>::Defined>
1139 template<typename T, bool = QMetaTypeId2<typename T::mapped_type>::Defined>
1153 template<
typename T>
1158 template<typename T, bool = QMetaTypeId2<typename T::first_type>::Defined
1168 template<
typename T>
1171 inline static bool registerConverter();
1174 template<
typename T>
1182 template<
typename T,
typename U>
1185 template<
typename T>
1188 template<
typename T,
typename =
void>
1194#if QT_CONFIG(future)
1195 template<
typename T>
1196 struct MetaTypeQFutureHelper
1198 static bool registerConverter() {
return false; }
1206 "Meta Types must be fully defined");
1207 static_assert(!std::is_reference_v<T>,
1208 "Meta Types cannot be non-const references or rvalue references.");
1210 using Pointed = std::remove_pointer_t<T>;
1212 "Pointer Meta Types must either point to fully-defined types "
1213 "or be declared with Q_DECLARE_OPAQUE_POINTER(T *)");
1221template <
typename T,
int =
1233template <
typename T>
1238template <
typename T>
1246template <
typename T>
1249template <
typename T>
1253 enum { Defined =
false, IsBuiltIn =
false };
1258 template <typename T, bool Defined = QMetaTypeId2<T>::Defined>
1269 template <
typename Result,
typename... Args>
1272 template<
typename T>
1275 template<typename T, bool = std::is_enum<T>::value>
1277 template<
typename T>
1278 constexpr bool IsUnsignedEnum<T, true> = !std::is_signed_v<std::underlying_type_t<T>>;
1280 template<
typename T>
1302 template<
typename T,
bool defined>
1308 template<
typename SmartPo
inter>
1313 return p.operator->();
1319 template <
typename T>
1320 struct EnableInternalDataWrap;
1322 template<
typename T>
1332template <
typename T>
1335#ifndef QT_NO_QOBJECT
1337 "qRegisterNormalizedMetaType",
1338 "qRegisterNormalizedMetaType was called with a not normalized type name, "
1339 "please call qRegisterMetaType instead.");
1342 const QMetaType metaType = QMetaType::fromType<T>();
1343 const int id = metaType.
id();
1351#if QT_CONFIG(future)
1352 QtPrivate::MetaTypeQFutureHelper<T>::registerConverter();
1355 if (normalizedTypeName != metaType.
name())
1371template <
typename T>
1374 return qRegisterNormalizedMetaTypeImplementation<T>(normalizedTypeName);
1377#define QT_DECL_METATYPE_EXTERN_TAGGED(TYPE, TAG, EXPORT) \
1378 QT_BEGIN_NAMESPACE \
1379 EXPORT int qRegisterNormalizedMetaType_ ## TAG (const QByteArray &); \
1380 template <> inline int qRegisterNormalizedMetaType< TYPE >(const QByteArray &name) \
1381 { return qRegisterNormalizedMetaType_ ## TAG (name); } \
1383 Q_DECLARE_METATYPE(TYPE) \
1385#define QT_IMPL_METATYPE_EXTERN_TAGGED(TYPE, TAG) \
1386 int qRegisterNormalizedMetaType_ ## TAG (const QByteArray &name) \
1387 { return qRegisterNormalizedMetaTypeImplementation< TYPE >(name); } \
1389#define QT_DECL_METATYPE_EXTERN(TYPE, EXPORT) \
1390 QT_DECL_METATYPE_EXTERN_TAGGED(TYPE, TYPE, EXPORT)
1391#define QT_IMPL_METATYPE_EXTERN(TYPE) \
1392 QT_IMPL_METATYPE_EXTERN_TAGGED(TYPE, TYPE)
1394template <
typename T>
1402 return qRegisterNormalizedMetaType<T>(normalizedTypeName);
1405template <
typename T>
1414 return QMetaType::fromType<T>().id();
1418template <
typename T>
1421 int id = qMetaTypeId<T>();
1427 return meta.registerHelper();
1430#ifndef QT_NO_QOBJECT
1431template <
typename T>
1441 if (
const int id = metatype_id.loadAcquire())
1443 const char *
const cName = T::staticMetaObject.className();
1445 typeName.reserve(strlen(cName) + 1);
1446 typeName.append(cName).append(
'*');
1447 const int newId = qRegisterNormalizedMetaType<T *>(
typeName);
1448 metatype_id.storeRelease(newId);
1453template <
typename T>
1457 Defined = std::is_default_constructible<T>::value
1463 if (
const int id = metatype_id.loadAcquire())
1465 const char *
const cName = T::staticMetaObject.className();
1466 const int newId = qRegisterNormalizedMetaType<T>(cName);
1467 metatype_id.storeRelease(newId);
1472template <
typename T>
1482 if (
const int id = metatype_id.loadAcquire())
1484 const char *
const cName = T::staticMetaObject.className();
1486 typeName.reserve(strlen(cName) + 1);
1487 typeName.append(cName).append(
'*');
1488 const int newId = qRegisterNormalizedMetaType<T *>(
typeName);
1489 metatype_id.storeRelease(newId);
1494template <
typename T>
1504 if (
const int id = metatype_id.loadAcquire())
1506 const char *eName = qt_getEnumName(T());
1507 const char *cName = qt_getEnumMetaObject(T())->className();
1509 typeName.reserve(strlen(cName) + 2 + strlen(eName));
1510 typeName.append(cName).append(
"::").append(eName);
1511 const int newId = qRegisterNormalizedMetaType<T>(
typeName);
1512 metatype_id.storeRelease(newId);
1518#define Q_DECLARE_OPAQUE_POINTER(POINTER) \
1519 QT_BEGIN_NAMESPACE namespace QtPrivate { \
1520 template <> struct IsPointerDeclaredOpaque<POINTER> \
1521 : std::true_type {}; \
1522 } QT_END_NAMESPACE \
1526#define Q_DECLARE_METATYPE(TYPE) Q_DECLARE_METATYPE_IMPL(TYPE)
1527#define Q_DECLARE_METATYPE_IMPL(TYPE) \
1528 QT_BEGIN_NAMESPACE \
1530 struct QMetaTypeId< TYPE > \
1532 enum { Defined = 1 }; \
1533 static_assert(QtPrivate::checkTypeIsSuitableForMetaType<TYPE>()); \
1534 static int qt_metatype_id() \
1536 Q_CONSTINIT static QBasicAtomicInt metatype_id = Q_BASIC_ATOMIC_INITIALIZER(0); \
1537 if (const int id = metatype_id.loadAcquire()) \
1539 constexpr auto arr = QtPrivate::typenameHelper<TYPE>(); \
1540 auto name = arr.data(); \
1541 if (QByteArrayView(name) == (#TYPE)) { \
1542 const int id = qRegisterNormalizedMetaType<TYPE>(name); \
1543 metatype_id.storeRelease(id); \
1546 const int newId = qRegisterMetaType< TYPE >(#TYPE); \
1547 metatype_id.storeRelease(newId); \
1554#define Q_DECLARE_BUILTIN_METATYPE(TYPE, METATYPEID, NAME) \
1555 QT_BEGIN_NAMESPACE \
1556 template<> struct QMetaTypeId2<NAME> \
1558 using NameAsArrayType = std::array<char, sizeof(#NAME)>; \
1559 enum { Defined = 1, IsBuiltIn = true, MetaType = METATYPEID }; \
1560 static inline constexpr int qt_metatype_id() { return METATYPEID; } \
1561 static constexpr NameAsArrayType nameAsArray = { #NAME }; \
1565#define QT_FORWARD_DECLARE_STATIC_TYPES_ITER(TypeName, TypeId, Name) \
1572#undef QT_FORWARD_DECLARE_STATIC_TYPES_ITER
1574#define Q_DECLARE_METATYPE_TEMPLATE_1ARG(SINGLE_ARG_TEMPLATE) \
1576template <typename T> \
1577struct QMetaTypeId< SINGLE_ARG_TEMPLATE<T> > \
1580 Defined = QMetaTypeId2<T>::Defined \
1582 static int qt_metatype_id() \
1584 Q_CONSTINIT static QBasicAtomicInt metatype_id = Q_BASIC_ATOMIC_INITIALIZER(0); \
1585 if (const int id = metatype_id.loadRelaxed()) \
1587 const char *tName = QMetaType::fromType<T>().name(); \
1589 const size_t tNameLen = qstrlen(tName); \
1590 QByteArray typeName; \
1591 typeName.reserve(sizeof(#SINGLE_ARG_TEMPLATE) + 1 + tNameLen + 1 + 1); \
1592 typeName.append(#SINGLE_ARG_TEMPLATE, int(sizeof(#SINGLE_ARG_TEMPLATE)) - 1) \
1593 .append('<').append(tName, tNameLen); \
1594 typeName.append('>'); \
1595 const int newId = qRegisterNormalizedMetaType< SINGLE_ARG_TEMPLATE<T> >(typeName); \
1596 metatype_id.storeRelease(newId); \
1602#define Q_DECLARE_METATYPE_TEMPLATE_2ARG(DOUBLE_ARG_TEMPLATE) \
1604template<typename T, typename U> \
1605struct QMetaTypeId< DOUBLE_ARG_TEMPLATE<T, U> > \
1608 Defined = QMetaTypeId2<T>::Defined && QMetaTypeId2<U>::Defined \
1610 static int qt_metatype_id() \
1612 Q_CONSTINIT static QBasicAtomicInt metatype_id = Q_BASIC_ATOMIC_INITIALIZER(0); \
1613 if (const int id = metatype_id.loadAcquire()) \
1615 const char *tName = QMetaType::fromType<T>().name(); \
1616 const char *uName = QMetaType::fromType<U>().name(); \
1619 const size_t tNameLen = qstrlen(tName); \
1620 const size_t uNameLen = qstrlen(uName); \
1621 QByteArray typeName; \
1622 typeName.reserve(sizeof(#DOUBLE_ARG_TEMPLATE) + 1 + tNameLen + 1 + uNameLen + 1 + 1); \
1623 typeName.append(#DOUBLE_ARG_TEMPLATE, int(sizeof(#DOUBLE_ARG_TEMPLATE)) - 1) \
1624 .append('<').append(tName, tNameLen).append(',').append(uName, uNameLen); \
1625 typeName.append('>'); \
1626 const int newId = qRegisterNormalizedMetaType< DOUBLE_ARG_TEMPLATE<T, U> >(typeName); \
1627 metatype_id.storeRelease(newId); \
1635template<
typename T,
bool =
false>
1649#define Q_DECLARE_SMART_POINTER_METATYPE(SMART_POINTER) \
1651namespace QtPrivate { \
1652template<typename T> \
1653struct SharedPointerMetaTypeIdHelper<SMART_POINTER<T>, true> \
1658 static int qt_metatype_id() \
1660 Q_CONSTINIT static QBasicAtomicInt metatype_id = Q_BASIC_ATOMIC_INITIALIZER(0); \
1661 if (const int id = metatype_id.loadAcquire()) \
1663 const char * const cName = T::staticMetaObject.className(); \
1664 QByteArray typeName; \
1665 typeName.reserve(sizeof(#SMART_POINTER) + 1 + strlen(cName) + 1); \
1666 typeName.append(#SMART_POINTER, int(sizeof(#SMART_POINTER)) - 1) \
1667 .append('<').append(cName).append('>'); \
1668 const int newId = qRegisterNormalizedMetaType< SMART_POINTER<T> >(typeName); \
1669 metatype_id.storeRelease(newId); \
1673template<typename T> \
1674struct MetaTypeSmartPointerHelper<SMART_POINTER<T> , \
1675 typename std::enable_if<IsPointerToTypeDerivedFromQObject<T*>::Value && !std::is_const_v<T>>::type> \
1677 static bool registerConverter() \
1679 const QMetaType to = QMetaType(QMetaType::QObjectStar); \
1680 if (!QMetaType::hasRegisteredConverterFunction(QMetaType::fromType<SMART_POINTER<T>>(), to)) { \
1681 QtPrivate::QSmartPointerConvertFunctor<SMART_POINTER<T> > o; \
1682 return QMetaType::registerConverter<SMART_POINTER<T>, QObject*>(o); \
1688template <typename T> \
1689struct QMetaTypeId< SMART_POINTER<T> > \
1690 : QtPrivate::SharedPointerMetaTypeIdHelper< SMART_POINTER<T>, \
1691 QtPrivate::IsPointerToTypeDerivedFromQObject<T*>::Value> \
1696#define Q_DECLARE_SEQUENTIAL_CONTAINER_METATYPE(SINGLE_ARG_TEMPLATE) \
1697 QT_BEGIN_NAMESPACE \
1698 namespace QtPrivate { \
1699 template<typename T> \
1700 struct IsSequentialContainer<SINGLE_ARG_TEMPLATE<T> > \
1702 enum { Value = true }; \
1706 Q_DECLARE_METATYPE_TEMPLATE_1ARG(SINGLE_ARG_TEMPLATE)
1708#define Q_DECLARE_SEQUENTIAL_CONTAINER_METATYPE_ITER(TEMPLATENAME) \
1709 Q_DECLARE_SEQUENTIAL_CONTAINER_METATYPE(TEMPLATENAME)
1715#undef Q_DECLARE_SEQUENTIAL_CONTAINER_METATYPE_ITER
1720#define Q_DECLARE_ASSOCIATIVE_CONTAINER_METATYPE(TEMPLATENAME) \
1721 QT_BEGIN_NAMESPACE \
1722 namespace QtPrivate { \
1723 template<typename T, typename U> \
1724 struct IsAssociativeContainer<TEMPLATENAME<T, U> > \
1726 enum { Value = true }; \
1730 Q_DECLARE_METATYPE_TEMPLATE_2ARG(TEMPLATENAME)
1738#define Q_DECLARE_METATYPE_TEMPLATE_SMART_POINTER_ITER(TEMPLATENAME) \
1739 Q_DECLARE_SMART_POINTER_METATYPE(TEMPLATENAME)
1745#undef Q_DECLARE_METATYPE_TEMPLATE_SMART_POINTER_ITER
1756Q_CORE_EXPORT
bool hasRegisteredConverterFunctionToPairVariantInterface(
QMetaType m);
1757Q_CORE_EXPORT
bool hasRegisteredConverterFunctionToIterableMetaSequence(
QMetaType m);
1758Q_CORE_EXPORT
bool hasRegisteredMutableViewFunctionToIterableMetaSequence(
QMetaType m);
1759Q_CORE_EXPORT
bool hasRegisteredConverterFunctionToIterableMetaAssociation(
QMetaType m);
1760Q_CORE_EXPORT
bool hasRegisteredMutableViewFunctionToIterableMetaAssociation(
QMetaType m);
1763template <
typename T>
1768 return QMetaType::registerConverter<T, QtMetaTypePrivate::QPairVariantInterfaceImpl>(
o);
1775template<
typename From>
1780 return QIterable<QMetaSequence>(QMetaSequence::fromContainer<From>(), &
f);
1784template<
typename From>
1789 return QIterable<QMetaSequence>(QMetaSequence::fromContainer<From>(), &
f);
1799 QSequentialIterableConvertFunctor<T>
o;
1800 return QMetaType::registerConverter<T, QIterable<QMetaSequence>>(
o);
1808 QSequentialIterableMutableViewFunctor<T>
o;
1809 return QMetaType::registerMutableView<T, QIterable<QMetaSequence>>(
o);
1815template<
typename From>
1820 return QIterable<QMetaAssociation>(QMetaAssociation::fromContainer<From>(), &
f);
1824template<
typename From>
1829 return QIterable<QMetaAssociation>(QMetaAssociation::fromContainer<From>(), &
f);
1841 QAssociativeIterableConvertFunctor<T>
o;
1842 return QMetaType::registerConverter<T, QIterable<QMetaAssociation>>(
o);
1850 QAssociativeIterableMutableViewFunctor<T>
o;
1851 return QMetaType::registerMutableView<T, QIterable<QMetaAssociation>>(
o);
1866 return ((
s >=
'a' &&
s <=
'z') || (
s >=
'A' &&
s <=
'Z') || (
s >=
'0' &&
s <=
'9')
1869 static constexpr bool is_space(
char s) {
return (
s ==
' ' ||
s ==
'\t' ||
s ==
'\n'); }
1870 static constexpr bool is_number(
char s) {
return s >=
'0' &&
s <=
'9'; }
1871 static constexpr bool starts_with_token(
const char *
b,
const char *e,
const char *
token,
1872 bool msvcKw =
false)
1889 static constexpr bool skipToken(
const char *&
x,
const char *e,
const char *
token,
1890 bool msvcKw =
false)
1892 if (!starts_with_token(
x, e,
token, msvcKw))
1900 static constexpr const char *skipString(
const char *
x,
const char *e)
1904 while (
x != e && *
x != delim) {
1916 static constexpr const char *skipTemplate(
const char *
x,
const char *e,
bool stopAtComa =
false)
1919 int templateDepth = 0;
1927 if (stopAtComa && !scopeDepth && !templateDepth)
1932 if (--templateDepth < 0)
1946 if (is_number(
x[-1]))
1950 x = skipString(
x, e);
1966 constexpr void replaceLast(
char x)
1973 constexpr void appendStr(
const char *
x)
1979 constexpr void normalizeIntegerTypes(
const char *&
begin,
const char *
end)
1983 int numUnsigned = 0;
1988 if (skipToken(
begin,
end,
"long")) {
1992 if (skipToken(
begin,
end,
"int")) {
1996 if (skipToken(
begin,
end,
"short")) {
2000 if (skipToken(
begin,
end,
"unsigned")) {
2004 if (skipToken(
begin,
end,
"signed")) {
2008 if (skipToken(
begin,
end,
"char")) {
2013 if (skipToken(
begin,
end,
"__int64")) {
2022 if (numSigned && numChar)
2023 appendStr(
"signed ");
2024 else if (numUnsigned)
2030 else if (numLong == 1)
2032 else if (numLong == 2)
2033 appendStr(
"longlong");
2034 else if (numUnsigned || numSigned || numInt)
2038 constexpr void skipStructClassOrEnum(
const char *&
begin,
const char *
end)
2042 skipToken(
begin,
end,
"struct",
true) || skipToken(
begin,
end,
"class",
true)
2043 || skipToken(
begin,
end,
"enum",
true);
2046 constexpr void skipQtNamespace(
const char *&
begin,
const char *
end)
2049 const char *nsbeg =
begin;
2050 if (skipToken(nsbeg,
end,
QT_STRINGIFY(QT_NAMESPACE)) && nsbeg + 2 <
end && nsbeg[0] ==
':'
2051 && nsbeg[1] ==
':') {
2063#if defined(Q_CC_CLANG) || defined (Q_CC_GNU)
2067 constexpr int normalizeTypeFromSignature(
const char *
begin,
const char *
end)
2071#if defined (Q_CC_CLANG)
2072 if (
name.find(
"anonymous ") != std::string_view::npos)
2075 if (
name.find(
"unnamed ") != std::string_view::npos)
2078 if (*
begin ==
' ') {
2079 if (last ==
',' || last ==
'>' || last ==
'<' || last ==
'*' || last ==
'&') {
2086 replaceLast(*
begin);
2126 const char *cst =
begin + 1;
2129 bool seenStar =
false;
2130 bool hasMiddleConst =
false;
2132 if (*cst ==
'\"' || (*cst ==
'\'' && !is_number(cst[-1]))) {
2133 cst = skipString(cst,
end);
2140 if (*cst ==
'&' || *cst ==
'*' || *cst ==
'[') {
2141 seenStar = *cst !=
'&' || cst != (
end - 1);
2145 cst = skipTemplate(cst + 1,
end);
2150 const char *skipedCst = cst;
2152 const char *testEnd =
end;
2153 while (skipedCst < testEnd--) {
2154 if (*testEnd ==
'*' || *testEnd ==
'['
2155 || (*testEnd ==
'&' && testEnd != (
end - 1))) {
2159 if (*testEnd ==
'>')
2162 if (adjustConst && !seenStar) {
2163 if (*(
end - 1) ==
'&')
2166 appendStr(
"const ");
2170 hasMiddleConst =
true;
2174 if (skipToken(
begin,
end,
"const")) {
2175 if (adjustConst && !seenStar) {
2176 if (*(
end - 1) ==
'&')
2179 appendStr(
"const ");
2182 if (seenStar && adjustConst) {
2183 const char *e =
end;
2184 if (*(
end - 1) ==
'&' && *(
end - 2) !=
'&')
2188 const char *
token =
"tsnoc";
2201 if (skipToken(
begin,
end,
"QVector")) {
2206 if (skipToken(
begin,
end,
"QPair")) {
2208 appendStr(
"std::pair");
2211 if (!hasMiddleConst)
2215 bool spaceSkiped =
true;
2220 }
else if ((
c ==
'\'' && !is_number(last)) ||
c ==
'\"') {
2229 spaceSkiped =
false;
2233 const char *tpl = skipTemplate(
begin,
end,
true);
2239 }
while (*
begin++ ==
',');
2258template <
typename T1_,
typename T2_>
2264namespace TypeNameHelper {
2266constexpr auto typenameHelper()
2276 t1Name = typenameHelper<T1>();
2281 t2Name = typenameHelper<T2>();
2283 constexpr auto nonTypeDependentLen =
sizeof(
"std::pair<,>");
2284 constexpr auto t1Len = t1Name.size() - 1;
2285 constexpr auto t2Len = t2Name.size() - 1;
2286 constexpr auto length = nonTypeDependentLen + t1Len + t2Len;
2287 std::array<char, length + 1>
result {};
2288 constexpr auto prefix =
"std::pair<";
2289 int currentLength = 0;
2290 for (; currentLength < int(
sizeof(
"std::pair<") - 1); ++currentLength)
2291 result[currentLength] = prefix[currentLength];
2292 for (
int i = 0;
i < int(t1Len); ++currentLength, ++
i)
2293 result[currentLength] = t1Name[
i];
2294 result[currentLength++] =
',';
2295 for (
int i = 0;
i < int(t2Len); ++currentLength, ++
i)
2296 result[currentLength] = t2Name[
i];
2297 result[currentLength++] =
'>';
2298 result[currentLength++] =
'\0';
2301 constexpr auto prefix =
sizeof(
2305#if defined(Q_CC_MSVC) && defined(Q_CC_CLANG)
2306 "auto __cdecl QtPrivate::TypeNameHelper::typenameHelper(void) [T = "
2307#elif defined(Q_CC_MSVC)
2308 "auto __cdecl QtPrivate::TypeNameHelper::typenameHelper<"
2309#elif defined(Q_CC_CLANG)
2310 "auto QtPrivate::TypeNameHelper::typenameHelper() [T = "
2311#elif defined(Q_CC_GHS)
2312 "auto QtPrivate::TypeNameHelper::typenameHelper<T>()[with T="
2314 "constexpr auto QtPrivate::TypeNameHelper::typenameHelper() [with T = "
2317#if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
2318 constexpr int suffix =
sizeof(
">(void)");
2320 constexpr int suffix =
sizeof(
"]");
2323#if defined(Q_CC_GNU_ONLY) && Q_CC_GNU_ONLY < 804
2331 constexpr const char *
begin =
func + prefix;
2335 std::array<char, len + 1>
result {};
2341using TypeNameHelper::typenameHelper;
2343template<
typename T,
typename =
void>
2349 : std::integral_constant<int, QMetaTypeId2<T>::MetaType>
2353template<
typename T,
bool = (QTypeTraits::has_operator_equal_v<T> && !std::is_po
inter_v<T>)>
2359 {
return *
reinterpret_cast<const T *
>(
a) == *
reinterpret_cast<const T *
>(
b); }
2369template<
typename T,
bool = (QTypeTraits::has_operator_less_than_v<T> && !std::is_po
inter_v<T>)>
2373 {
return *
reinterpret_cast<const T *
>(
a) < *
reinterpret_cast<const T *
>(
b); }
2382template<
typename T,
bool = (QTypeTraits::has_ostream_operator_v<QDebug, T> && !std::is_po
inter_v<T>)>
2386 { dbg << *reinterpret_cast<const T *>(
a); }
2395template<
typename T,
bool = QTypeTraits::has_stream_operator_v<QDataStream, T>>
2402#ifndef QT_NO_DATASTREAM
2407 { ds << *reinterpret_cast<const T *>(
a); }
2409 { ds >> *
reinterpret_cast<T *
>(
a); }
2423#if !defined(Q_OS_WIN) && defined(Q_CC_CLANG)
2424# pragma GCC visibility push(hidden)
2431 static constexpr decltype(typenameHelper<S>())
name = typenameHelper<S>();
2445 if constexpr (std::is_copy_constructible_v<S> && !std::is_trivially_copy_constructible_v<S>) {
2447 new (
addr) S(*
reinterpret_cast<const S *
>(
other));
2456 if constexpr (std::is_move_constructible_v<S> && !std::is_trivially_move_constructible_v<S>) {
2458 new (
addr) S(std::move(*
reinterpret_cast<S *
>(
other)));
2467 if constexpr (std::is_destructible_v<S> && !std::is_trivially_destructible_v<S>)
2469 reinterpret_cast<S *
>(
addr)->~S();
2501 using InterfaceType = std::conditional_t<IsConstMetaTypeInterface, const QMetaTypeInterface, NonConstMetaTypeInterface>;
2504 QMetaTypeInterface::CurrentRevision,
2524#if !defined(Q_OS_WIN) && defined(Q_CC_CLANG)
2525# pragma GCC visibility pop
2564#if !defined(QT_BOOTSTRAPPED) && !defined(Q_CC_MSVC) && !defined(Q_OS_INTEGRITY)
2566#ifdef QT_NO_DATA_RELOCATION
2567# define QT_METATYPE_DECLARE_EXTERN_TEMPLATE_ITER(TypeName, Id, Name) \
2568 extern template class Q_CORE_EXPORT QMetaTypeForType<Name>;
2570# define QT_METATYPE_DECLARE_EXTERN_TEMPLATE_ITER(TypeName, Id, Name) \
2571 extern template class Q_CORE_EXPORT QMetaTypeForType<Name>; \
2572 extern template struct Q_CORE_EXPORT QMetaTypeInterfaceWrapper<Name>;
2580#undef QT_METATYPE_DECLARE_EXTERN_TEMPLATE_ITER
2586 using type = std::remove_pointer_t<T>;
2589#define Q_REMOVE_POINTER_LIKE_IMPL(Pointer) \
2590template <typename T> \
2591struct qRemovePointerLike<Pointer<T>> \
2599#undef Q_REMOVE_POINTER_LIKE_IMPL
2601template<
typename T,
typename ForceComplete_>
2616template<
typename Unique,
typename TypeCompletePair>
2619 using T =
typename TypeCompletePair::type;
2620 using ForceComplete =
typename TypeCompletePair::ForceComplete;
2622 using Tz = qRemovePointerLike_t<Ty>;
2624 if constexpr (std::is_void_v<Tz>) {
2627 }
else if constexpr (ForceComplete::value) {
2628 checkTypeIsSuitableForMetaType<Ty>();
2630 }
else if constexpr (std::is_reference_v<Tz>) {
2645 QtPrivate::checkTypeIsSuitableForMetaType<T>();
2646 return QMetaType(QtPrivate::qMetaTypeInterfaceForType<T>());
2651 return d_ptr ? d_ptr->size : 0;
2656 return d_ptr ? d_ptr->alignment : 0;
2661 return d_ptr ? TypeFlags(d_ptr->flags) : TypeFlags{};
2666 return d_ptr && d_ptr->metaObjectFn ? d_ptr->metaObjectFn(d_ptr) :
nullptr;
2669template<
typename... T>
2678 QtPrivate::qTryMetaTypeInterfaceForType<void, QtPrivate::TypeAndForceComplete<T, std::true_type>>()...
2683 return d_ptr ? d_ptr->name :
nullptr;
2686template<
typename Unique,
typename... T>
2688 QtPrivate::qTryMetaTypeInterfaceForType<Unique, T>()...
2701 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