diff options
| author | Thiago Macieira <thiago.macieira@intel.com> | 2024-08-27 10:11:06 -0700 |
|---|---|---|
| committer | Thiago Macieira <thiago.macieira@intel.com> | 2024-09-30 15:08:37 -0700 |
| commit | 268006ee2f7c5f736ed3d16cdf126fdb28a9dc3b (patch) | |
| tree | 93e3f021b1d66236460a34908cfcd850c27db6fa /src/corelib/kernel/qmetaobject.cpp | |
| parent | da4a6cf78ff42a4f69c2775997ff174ef647f3f3 (diff) | |
QArgumentType: store a QMetaType instead of an id
This would avoid an indirection through the QMetaType constructor. But
I'm also making it so effectively we either have valid QMetaTypes or we
don't. If it can be looked up in the constructor, then string
comparisons aren't necessary at all.
Change-Id: I9a3b2a1a781c27c7271afffd3e5acbca06632476
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/corelib/kernel/qmetaobject.cpp')
| -rw-r--r-- | src/corelib/kernel/qmetaobject.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 83f670d9a50..e2e3c9b8083 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -646,10 +646,11 @@ bool QMetaObjectPrivate::methodMatch(const QMetaObject *m, const QMetaMethod &me int paramsIndex = data.parameters() + 1; for (int i = 0; i < argc; ++i) { uint typeInfo = m->d.data[paramsIndex + i]; - if (int id = types[i].type()) { - if (id == QMetaType(ifaces[i]).id()) + QMetaType mt = types[i].metaType(); + if (mt.isValid()) { + if (mt == QMetaType(ifaces[i])) continue; - if (id != typeFromTypeInfo(m, typeInfo)) + if (mt.id() != typeFromTypeInfo(m, typeInfo)) return false; } else { if (types[i].name() == QMetaType(ifaces[i]).name()) @@ -3994,7 +3995,7 @@ int QMetaProperty::notifySignalIndex() const if (idx >= 0) return idx + m->methodOffset(); // try 1-arg signal - QArgumentType argType(typeId()); + QArgumentType argType(metaType()); idx = QMetaObjectPrivate::indexOfMethodRelative<MethodSignal>(&m, signalName, 1, &argType); if (idx >= 0) return idx + m->methodOffset(); |
