summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qmetaobject.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2024-08-10 15:31:43 -0700
committerThiago Macieira <thiago.macieira@intel.com>2024-09-29 21:33:54 -0700
commitda4a6cf78ff42a4f69c2775997ff174ef647f3f3 (patch)
treec057df4685b14ef98906e0eb12c995147787ecfe /src/corelib/kernel/qmetaobject.cpp
parent3e6eb30a80de57d327d74896d13f82af2c76c82c (diff)
moc: generate the uint data using the new constexpr functions
We needed to go through two levels of indirection to generate it for classes. First, it needs to be inside the context of the class or namespace in question, hence the need for a qt_create_metaobjectdata() member function. This is necessary because moc does not know what context some property types are, like "Error": they may be a nested type in the class or local to this namespace. Doing this also gains us access to everything the class has access to. (The metatype array avoided this problem by declaring the types as template parameters in the context of the staticMetaObject, so it transitively gained the same access we now do) Second, because the class itself may be private, we need a way to call the function we've just defined without naming it, so we insert a template friend in Q_OBJECT & Q_GADGET, which we can define in the moc output. We multiplex it using the 1:1 association with the token type that moc already defines. The member function is a template so no compiler will attempt to export it. Moreover, our specialization is keyed to a type in an unnamed namespace. The changes to tst_QVariant are temporary, because it is abusing the Q_ENUM marker on a 64-bit enumeration. Task-number: QTBUG-111926 Change-Id: I8a96935cf6c742259c9dfffd17e951563adde9a1 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/kernel/qmetaobject.cpp')
0 files changed, 0 insertions, 0 deletions