diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-10-07 07:42:08 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-10-07 07:43:22 (GMT) |
commit | 803bdd187ec1673541b7ef8dc69652c10d0e6f88 (patch) | |
tree | 9fd62d77b792ebb6b63229a6bde562534d1bcf0f /src/declarative/qml/qdeclarativenotifier.cpp | |
parent | daade9bb4f1362ec0ced42e8ce2c0d7f42be88c9 (diff) | |
download | Qt-803bdd187ec1673541b7ef8dc69652c10d0e6f88.zip Qt-803bdd187ec1673541b7ef8dc69652c10d0e6f88.tar.gz Qt-803bdd187ec1673541b7ef8dc69652c10d0e6f88.tar.bz2 |
Connect property alias change signals on use
Task-number: QTBUG-14089
Diffstat (limited to 'src/declarative/qml/qdeclarativenotifier.cpp')
-rw-r--r-- | src/declarative/qml/qdeclarativenotifier.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/declarative/qml/qdeclarativenotifier.cpp b/src/declarative/qml/qdeclarativenotifier.cpp index 8c946f8..2e3f756 100644 --- a/src/declarative/qml/qdeclarativenotifier.cpp +++ b/src/declarative/qml/qdeclarativenotifier.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include "private/qdeclarativenotifier_p.h" +#include "private/qdeclarativeproperty_p.h" QT_BEGIN_NAMESPACE @@ -66,6 +67,21 @@ void QDeclarativeNotifier::emitNotify(QDeclarativeNotifierEndpoint *endpoint) if (oldDisconnected) *oldDisconnected = endpoint; } +void QDeclarativeNotifierEndpoint::connect(QObject *source, int sourceSignal) +{ + Signal *s = toSignal(); + + if (s->source == source && s->sourceSignal == sourceSignal) + return; + + disconnect(); + + QDeclarativePropertyPrivate::connect(source, sourceSignal, target, targetMethod); + + s->source = source; + s->sourceSignal = sourceSignal; +} + void QDeclarativeNotifierEndpoint::copyAndClear(QDeclarativeNotifierEndpoint &other) { other.disconnect(); |