diff options
author | Fabian Kosmale <[email protected]> | 2025-02-25 16:18:36 +0100 |
---|---|---|
committer | Fabian Kosmale <[email protected]> | 2025-02-26 15:31:34 +0100 |
commit | 7216eb292f730c14e649358f6435a7e758f4db13 (patch) | |
tree | f66334d8a11fe71c2f966d9675980f1aa3801dd9 | |
parent | fb1824a9d669c601ebd540c9ca16a9687d7d9706 (diff) |
QSignalSpy: Drop the RegisterMethodArgumentMetaType metacall
There's nothing the meta-call could achieve: If the argument tpye was
complete when the meta-object was created, we would already have created
the metatype-interface for it, and would return a QMetaType constructed
from it in QMetaMethod::parameterMetatype. If the type wasn't complete,
parameterMetatype would have done the name to type lookup.
Consequently, if the lookup failed so far, calling
RegisterMethodArgumentMetaType would not help either, unless we would
have a dynamic meta-object with a custom implementation of
RegisterMethodArgumentMetaType. Such an implementation does not exist in
Qt.
This removes the last remaining user of RegisterMethodArgumentMetaType.
Change-Id: I9b9abbc3b4ba573b242027ecaa230ea27cb2ebf6
Reviewed-by: Thiago Macieira <[email protected]>
Reviewed-by: MÃ¥rten Nordheim <[email protected]>
-rw-r--r-- | src/testlib/qsignalspy.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/testlib/qsignalspy.cpp b/src/testlib/qsignalspy.cpp index 116ce87c3eb..02d783f7b14 100644 --- a/src/testlib/qsignalspy.cpp +++ b/src/testlib/qsignalspy.cpp @@ -216,18 +216,12 @@ QSignalSpy::ObjectSignal QSignalSpy::verify(const QObject *obj, QMetaMethod sign return {}; } -static QList<int> makeArgs(QMetaMethod member, const QObject *obj) +static QList<int> makeArgs(QMetaMethod member) { QList<int> result; result.reserve(member.parameterCount()); for (int i = 0; i < member.parameterCount(); ++i) { QMetaType tp = member.parameterMetaType(i); - if (!tp.isValid() && obj) { - void *argv[] = { &tp, &i }; - QMetaObject::metacall(const_cast<QObject*>(obj), - QMetaObject::RegisterMethodArgumentMetaType, - member.methodIndex(), argv); - } if (!tp.isValid()) { qWarning("QSignalSpy: Unable to handle parameter '%s' of type '%s' of method '%s'," " use qRegisterMetaType to register it.", @@ -251,7 +245,7 @@ public: QSignalSpy::QSignalSpy(ObjectSignal os) : sig(os.sig.methodSignature()), - args(os.obj ? makeArgs(os.sig, os.obj) : QList<int>{}) + args(os.obj ? makeArgs(os.sig) : QList<int>{}) { if (!os.obj) return; |