QObject: Check for declarative signals in isSignalConnected
Amends a952fd7d5b03ce1968ec58871fbb8b3600895900. The mentioned commit started to skip QObjectPrivate::isSignalConnected() call if the connectionLists are dirty, which lead to tst_qqmllanguage::receivers() test inside qtdeclarative breaking. Declarative signals were not checked if that function was not called. It previously also wasn't called for signals higher than 64. Fix that by checking for declarative signals after the connectionLists search is unsuccessful. Fixes: QTBUG-71550 Change-Id: Ifcb5fdd0dc9a6b14b9f448a016fd09356a55b985 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
parent
2569ac2857
commit
b971310e2d
@ -2513,22 +2513,21 @@ bool QObject::isSignalConnected(const QMetaMethod &signal) const
|
||||
signalIndex += QMetaObjectPrivate::signalOffset(signal.mobj);
|
||||
|
||||
QMutexLocker locker(signalSlotLock(this));
|
||||
if (!d->connectionLists)
|
||||
return false;
|
||||
if (d->connectionLists) {
|
||||
if (signalIndex < sizeof(d->connectedSignals) * 8 && !d->connectionLists->dirty)
|
||||
return d->isSignalConnected(signalIndex);
|
||||
|
||||
if (signalIndex < sizeof(d->connectedSignals) * 8 && !d->connectionLists->dirty)
|
||||
return d->isSignalConnected(signalIndex);
|
||||
|
||||
if (signalIndex < uint(d->connectionLists->count())) {
|
||||
const QObjectPrivate::Connection *c =
|
||||
d->connectionLists->at(signalIndex).first;
|
||||
while (c) {
|
||||
if (c->receiver)
|
||||
return true;
|
||||
c = c->nextConnectionList;
|
||||
if (signalIndex < uint(d->connectionLists->count())) {
|
||||
const QObjectPrivate::Connection *c =
|
||||
d->connectionLists->at(signalIndex).first;
|
||||
while (c) {
|
||||
if (c->receiver)
|
||||
return true;
|
||||
c = c->nextConnectionList;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return d->isDeclarativeSignalConnected(signalIndex);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
Loading…
x
Reference in New Issue
Block a user