QObject: count declarative receivers also if there are no C++ ones
Change-Id: If998cdd5eeb8a3ae85cd540cc9c1fd0c051e1d4b Fixes: QTBUG-73753 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
parent
783953f09d
commit
46589056c3
@ -2404,8 +2404,7 @@ int QObject::receivers(const char *signal) const
|
||||
{
|
||||
Q_D(const QObject);
|
||||
int receivers = 0;
|
||||
QObjectPrivate::ConnectionData *cd = d->connections.load();
|
||||
if (signal && cd) {
|
||||
if (signal) {
|
||||
QByteArray signal_name = QMetaObject::normalizedSignature(signal);
|
||||
signal = signal_name;
|
||||
#ifndef QT_NO_DEBUG
|
||||
@ -2429,8 +2428,9 @@ int QObject::receivers(const char *signal) const
|
||||
signal_index);
|
||||
}
|
||||
|
||||
QObjectPrivate::ConnectionData *cd = d->connections.load();
|
||||
QBasicMutexLocker locker(signalSlotLock(this));
|
||||
if (signal_index < cd->signalVector.count()) {
|
||||
if (cd && signal_index < cd->signalVector.count()) {
|
||||
const QObjectPrivate::Connection *c =
|
||||
cd->signalVector.at(signal_index).first;
|
||||
while (c) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user