diff options
| author | Ahmad Samir <a.samirh78@gmail.com> | 2025-08-10 19:48:43 +0300 |
|---|---|---|
| committer | Ahmad Samir <a.samirh78@gmail.com> | 2025-09-08 22:28:05 +0300 |
| commit | 41ee90f64b713f3037357ec629eaeb8f2c9539a6 (patch) | |
| tree | ffceeda2f6918560eefe10d8185f9eafdc028d2d /src/corelib/kernel/qmetaobject.cpp | |
| parent | 67abb290be80024cd36cc4c78d4e74c3ff705dba (diff) | |
QMetaObject: de-duplicate code
Pick-to: 6.10
Change-Id: Ib6261e92512fb6b085604830f02afdff423349e5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qmetaobject.cpp')
| -rw-r--r-- | src/corelib/kernel/qmetaobject.cpp | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index a00a6d1aa42..db10b1cbd2f 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -798,14 +798,10 @@ int QMetaObject::indexOfConstructor(const char *constructor) const static int indexOfMethod_helper(const QMetaObject *m, const char *method) { - int i; Q_ASSERT(priv(m->d.data)->revision >= 7); QArgumentTypeArray types; QByteArrayView name = QMetaObjectPrivate::decodeMethodSignature(method, types); - i = QMetaObjectPrivate::indexOfMethodRelative<0>(&m, name, types); - if (i >= 0) - i += m->methodOffset(); - return i; + return QMetaObjectPrivate::indexOfMethod(m, name, types); } int QMetaObject::indexOfMethod(const char *method) const @@ -849,14 +845,10 @@ QByteArrayView QMetaObjectPrivate::decodeMethodSignature( static int indexOfSignal_helper(const QMetaObject *m, const char *signal) { - int i; Q_ASSERT(priv(m->d.data)->revision >= 7); QArgumentTypeArray types; QByteArrayView name = QMetaObjectPrivate::decodeMethodSignature(signal, types); - i = QMetaObjectPrivate::indexOfSignalRelative(&m, name, types); - if (i >= 0) - i += m->methodOffset(); - return i; + return QMetaObjectPrivate::indexOfSignal(m, name, types); } int QMetaObject::indexOfSignal(const char *signal) const @@ -905,14 +897,10 @@ int QMetaObjectPrivate::indexOfSignalRelative(const QMetaObject **baseObject, static int indexOfSlot_helper(const QMetaObject *m, const char *slot) { - int i; Q_ASSERT(priv(m->d.data)->revision >= 7); QArgumentTypeArray types; QByteArrayView name = QMetaObjectPrivate::decodeMethodSignature(slot, types); - i = QMetaObjectPrivate::indexOfSlotRelative(&m, name, types); - if (i >= 0) - i += m->methodOffset(); - return i; + return QMetaObjectPrivate::indexOfSlot(m, name, types); } int QMetaObject::indexOfSlot(const char *slot) const |
