diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/qml/qdeclarativeboundsignal.cpp | 1 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeproperty.cpp | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativeboundsignal.cpp b/src/declarative/qml/qdeclarativeboundsignal.cpp index 9bccb42..720c725 100644 --- a/src/declarative/qml/qdeclarativeboundsignal.cpp +++ b/src/declarative/qml/qdeclarativeboundsignal.cpp @@ -136,6 +136,7 @@ QDeclarativeBoundSignal::~QDeclarativeBoundSignal() void QDeclarativeBoundSignal::disconnect() { + QMetaObject::disconnect(m_scope, m_signal.methodIndex(), this, evaluateIdx); QObjectPrivate * const priv = QObjectPrivate::get(m_scope); QVarLengthArray<char> signalSignature; QObjectPrivate::signalSignature(m_signal, &signalSignature); diff --git a/src/declarative/qml/qdeclarativeproperty.cpp b/src/declarative/qml/qdeclarativeproperty.cpp index ce4122a..6ad94c2 100644 --- a/src/declarative/qml/qdeclarativeproperty.cpp +++ b/src/declarative/qml/qdeclarativeproperty.cpp @@ -1632,13 +1632,18 @@ bool QDeclarativePropertyPrivate::connect(QObject *sender, int signal_index, flush_vme_signal(sender, signal_index); flush_vme_signal(receiver, method_index); + const bool result = + QMetaObject::connect(sender, signal_index, receiver, method_index, type, types); + + // connectNotify() needs to be called after the actual connect, as otherwise QObject::receivers() + // would return the wrong result inside connectNotify(). const QMetaMethod signal = sender->metaObject()->method(signal_index); QObjectPrivate * const senderPriv = QObjectPrivate::get(sender); QVarLengthArray<char> signalSignature; QObjectPrivate::signalSignature(signal, &signalSignature); senderPriv->connectNotify(signalSignature.constData()); - return QMetaObject::connect(sender, signal_index, receiver, method_index, type, types); + return result; } /*! |