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
|
if (sigIndex < 0) { // search for compatible signals
|
||||||
const QMetaObject *smo = co->metaObject();
|
const QMetaObject *smo = co->metaObject();
|
||||||
int slotlen = qstrlen(slot + len + 4) - 1;
|
int slotlen = qstrlen(slot + len + 4) - 1;
|
||||||
for (int k = 0; k < smo->methodCount(); ++k) {
|
for (int k = 0; k < QMetaObjectPrivate::absoluteSignalCount(smo); ++k) {
|
||||||
QMetaMethod method = smo->method(k);
|
QMetaMethod method = QMetaObjectPrivate::signal(smo, k);
|
||||||
if (method.methodType() != QMetaMethod::Signal)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (!qstrncmp(method.methodSignature().constData(), slot + len + 4, slotlen)) {
|
if (!qstrncmp(method.methodSignature().constData(), slot + len + 4, slotlen)) {
|
||||||
smeta = method.enclosingMetaObject();
|
smeta = method.enclosingMetaObject();
|
||||||
int signalOffset, methodOffset;
|
sigIndex = k;
|
||||||
computeOffsets(smeta, &signalOffset, &methodOffset);
|
|
||||||
sigIndex = k + - methodOffset + signalOffset;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user