aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlnotifier_p.h
diff options
context:
space:
mode:
authorThomas McGuire <thomas.mcguire@kdab.com>2012-07-17 17:35:53 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-22 12:25:33 +0200
commit26ea8e01e9ee2a8c8c09266147b94c9ac92d09f9 (patch)
treec058873b0082b18a09dde27f7ee124285e696807 /src/qml/qml/qqmlnotifier_p.h
parent2cc57f1e33cc4d739b1b76c605e6241fa0f134a8 (diff)
Make connectNotify() work with QML
Call connectNotify() and disconnectNotify() in QQmlNotifierEndPoint, which works for QML signal handlers and for QML bindings. Task-number: QTBUG-11284 Change-Id: Ic9a08ee6687e5c7e606f315c8fb30eec1493cd83 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmlnotifier_p.h')
-rw-r--r--src/qml/qml/qqmlnotifier_p.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlnotifier_p.h b/src/qml/qml/qqmlnotifier_p.h
index 7f5606fd68..2e5288291c 100644
--- a/src/qml/qml/qqmlnotifier_p.h
+++ b/src/qml/qml/qqmlnotifier_p.h
@@ -44,6 +44,8 @@
#include "qqmldata_p.h"
#include "qqmlguard_p.h"
+#include <QtCore/qmetaobject.h>
+#include <private/qmetaobject_p.h>
QT_BEGIN_NAMESPACE
@@ -187,6 +189,11 @@ void QQmlNotifierEndpoint::connect(QQmlNotifier *notifier)
void QQmlNotifierEndpoint::disconnect()
{
+ if (sourceSignal != -1) {
+ QObject * const obj = senderAsObject();
+ QObjectPrivate * const priv = QObjectPrivate::get(obj);
+ priv->disconnectNotify(QMetaObjectPrivate::signal(obj->metaObject(), sourceSignal));
+ }
if (next) next->prev = prev;
if (prev) *prev = next;
if (isNotifying()) *((intptr_t *)(senderPtr & ~0x1)) = 0;