Simplify connectSlotsByName() implementation
Use the new signal index-based API. Change-Id: I89263f5366726ef8213e45e5ab6575ebd6eab04a Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This commit is contained in:
parent
98c7afb8d6
commit
3057c4173b
@ -3210,16 +3210,11 @@ void QMetaObject::connectSlotsByName(QObject *o)
|
||||
if (sigIndex < 0) { // search for compatible signals
|
||||
const QMetaObject *smo = co->metaObject();
|
||||
int slotlen = qstrlen(slot + len + 4) - 1;
|
||||
for (int k = 0; k < smo->methodCount(); ++k) {
|
||||
QMetaMethod method = smo->method(k);
|
||||
if (method.methodType() != QMetaMethod::Signal)
|
||||
continue;
|
||||
|
||||
for (int k = 0; k < QMetaObjectPrivate::absoluteSignalCount(smo); ++k) {
|
||||
QMetaMethod method = QMetaObjectPrivate::signal(smo, k);
|
||||
if (!qstrncmp(method.methodSignature().constData(), slot + len + 4, slotlen)) {
|
||||
smeta = method.enclosingMetaObject();
|
||||
int signalOffset, methodOffset;
|
||||
computeOffsets(smeta, &signalOffset, &methodOffset);
|
||||
sigIndex = k + - methodOffset + signalOffset;
|
||||
sigIndex = k;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user