summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qmetaobject.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2024-08-07 07:56:55 -0700
committerThiago Macieira <thiago.macieira@intel.com>2024-09-21 09:39:14 -0700
commite2290b104fcbf1f7a035ce6a44248b5fe2e471bb (patch)
treeedd9b6223d4eff131ef2e6e72773643b4d61aa22 /src/corelib/kernel/qmetaobject.cpp
parentd4348cc9b4cadca3585872ee8632a47c6ec85101 (diff)
moc & QMetaObject: move the QMetaMethod revision information
Instead of storing them as an array for every single method (some of which may not have revisions) at a different location in the uint array, store the revision after the parameter type and name lists, in the usual place. This is not implemented for the old integer table in moc, because it's going away. [ChangeLog][Important Behavior Changes] With Qt 6.9, the layout of the meta object data table changed incompatibly for classes containing meta methods (signals, slots) marked with Q_REVISION. This is marked by the presence of revision 13 or later. Code that reads or writes the meta object's raw data directly instead of using QMetaMethod must detect the new layout. Change-Id: I8a96935cf6c742259c9dfffd17e97a2530b52b3e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/corelib/kernel/qmetaobject.cpp')
-rw-r--r--src/corelib/kernel/qmetaobject.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index bd1cfe5a1b8..83f670d9a50 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -2331,13 +2331,19 @@ int QMetaMethod::revision() const
{
if (!mobj)
return 0;
- if (data.flags() & MethodRevisioned) {
+ if ((data.flags() & MethodRevisioned) == 0)
+ return 0;
+#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
+ if (priv(mobj->d.data)->revision < 13) {
+ // revision number located elsewhere
int offset = priv(mobj->d.data)->methodData
+ priv(mobj->d.data)->methodCount * Data::Size
+ QMetaMethodPrivate::get(this)->ownMethodIndex();
return mobj->d.data[offset];
}
- return 0;
+#endif
+
+ return mobj->d.data[data.parameters() - 1];
}
/*!