From fa987d44417528856d5e80ed7b48ba99e19fa307 Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Thu, 19 Mar 2020 10:47:29 +0100 Subject: MetaObject: Store the QMetaType of the methods This does the analog of 46f407126ef3e94d59254012cdc34d6a4ad2faf2 for the methods we care about (signals, slots, Q_INVOKABLEs). In addition to the actual QMetaType, we store an array with offsets so that we later can do a mapping from methodIndex to metatype. The newly added QMetaMethod::{return,parameter}MetaType methods can then be used to retrieve the metatypes. This does however require that all involved types are complete. This is unfortunately not a feasible requirement. Thus, we only populate the metatype array on a best effort basis. For any incomplete type, we store QMetaType::Unknown. Then, when accessing the metatype, we fall back to the old string based code base if it's Unknown. Squashes "moc: support incomplete types" and "Fix compile failures after QMetaMethod change" Fixes: QTBUG-82932 Change-Id: I6b7a587cc364b7cad0c158d6de54e8a204289ad4 Reviewed-by: Lars Knoll --- src/corelib/kernel/qmetaobject_p.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/corelib/kernel/qmetaobject_p.h') diff --git a/src/corelib/kernel/qmetaobject_p.h b/src/corelib/kernel/qmetaobject_p.h index 49c43e3d79..b825c983f9 100644 --- a/src/corelib/kernel/qmetaobject_p.h +++ b/src/corelib/kernel/qmetaobject_p.h @@ -176,7 +176,9 @@ struct QMetaObjectPrivate { // revision 7 is Qt 5.0 everything lower is not supported // revision 8 is Qt 5.12: It adds the enum name to QMetaEnum - enum { OutputRevision = 8 }; // Used by moc, qmetaobjectbuilder and qdbus + // revision 9 is Qt 6.0: It adds the metatype of properties and methods + enum { OutputRevision = 9 }; // Used by moc, qmetaobjectbuilder and qdbus + enum { IntsPerMethod = 6}; int revision; int className; -- cgit v1.2.3