diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/kernel/qobject.cpp | 17 | ||||
-rw-r--r-- | src/corelib/kernel/qobject_p.h | 2 |
2 files changed, 14 insertions, 5 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index fb01df3099..db2b086ff2 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -3309,7 +3309,7 @@ bool QMetaObjectPrivate::disconnectHelper(QObjectPrivate::Connection *c, while (c) { if (c->receiver && (receiver == 0 || (c->receiver == receiver - && (method_index < 0 || c->method() == method_index) + && (method_index < 0 || (!c->isSlotObject && c->method() == method_index)) && (slot == 0 || (c->isSlotObject && c->slotObj->compare(slot)))))) { bool needToUnlock = false; QMutex *receiverMutex = 0; @@ -3999,6 +3999,11 @@ void QObject::dumpObjectInfo() c = c->nextConnectionList; continue; } + if (c->isSlotObject) { + qDebug(" <functor or function pointer>"); + c = c->nextConnectionList; + continue; + } const QMetaObject *receiverMetaObject = c->receiver->metaObject(); const QMetaMethod method = receiverMetaObject->method(c->method()); qDebug(" --> %s::%s %s", @@ -4017,11 +4022,15 @@ void QObject::dumpObjectInfo() if (d->senders) { for (QObjectPrivate::Connection *s = d->senders; s; s = s->next) { - const QMetaMethod slot = metaObject()->method(s->method()); - qDebug(" <-- %s::%s %s", + QByteArray slotName = QByteArrayLiteral("<unknown>"); + if (!s->isSlotObject) { + const QMetaMethod slot = metaObject()->method(s->method()); + slotName = slot.methodSignature(); + } + qDebug(" <-- %s::%s %s", s->sender->metaObject()->className(), s->sender->objectName().isEmpty() ? "unnamed" : qPrintable(s->sender->objectName()), - slot.methodSignature().constData()); + slotName.constData()); } } else { qDebug(" <None>"); diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h index 180887b370..95d64873e0 100644 --- a/src/corelib/kernel/qobject_p.h +++ b/src/corelib/kernel/qobject_p.h @@ -149,7 +149,7 @@ public: //ref_ is 2 for the use in the internal lists, and for the use in QMetaObject::Connection } ~Connection(); - int method() const { return method_offset + method_relative; } + int method() const { Q_ASSERT(!isSlotObject); return method_offset + method_relative; } void ref() { ref_.ref(); } void deref() { if (!ref_.deref()) { |