summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorThomas McGuire <thomas.mcguire.qnx@kdab.com>2012-08-06 07:36:05 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-08-31 13:08:29 (GMT)
commit3c4c970962d75a902ff14a1c8b3adb36895c4ffa (patch)
tree6f6a4060c3e6b9179ac731398f7832427aa28fb1 /src/corelib/kernel
parent43669c58027b9e6ba76b6b2ca6059ab3d9e8c0ea (diff)
downloadQt-3c4c970962d75a902ff14a1c8b3adb36895c4ffa.zip
Qt-3c4c970962d75a902ff14a1c8b3adb36895c4ffa.tar.gz
Qt-3c4c970962d75a902ff14a1c8b3adb36895c4ffa.tar.bz2
Make connectNotify() work with QML
Call connectNotify() and disconnectNotify() in QML signal handlers and in QML bindings. This is a backport of Qt5's QtDeclarative commit 26ea8e01e9ee2a8c8c09266147b94c9ac92d09f9. Task-number: QTBUG-11284 Change-Id: If5c3701426208875f3b775040c4e7bcbaac2b0a9 Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qobject_p.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h
index 3d9ea64..c7aa683 100644
--- a/src/corelib/kernel/qobject_p.h
+++ b/src/corelib/kernel/qobject_p.h
@@ -179,6 +179,11 @@ public:
int signalIndex(const char *signalName) const;
inline bool isSignalConnected(uint signalIdx) const;
+ // To allow arbitrary objects to call connectNotify()/disconnectNotify() without making
+ // the API public in QObject. This is used by QDeclarativeNotifierEndpoint.
+ inline void connectNotify(const char *signal);
+ inline void disconnectNotify(const char *signal);
+
public:
QString objectName;
ExtraData *extraData; // extra data set by the user
@@ -229,6 +234,16 @@ inline bool QObjectPrivate::isSignalConnected(uint signal_index) const
|| qt_signal_spy_callback_set.signal_end_callback);
}
+inline void QObjectPrivate::connectNotify(const char *signal)
+{
+ q_ptr->connectNotify(signal);
+}
+
+inline void QObjectPrivate::disconnectNotify(const char *signal)
+{
+ q_ptr->disconnectNotify(signal);
+}
+
inline QObjectPrivate::Sender *QObjectPrivate::setCurrentSender(QObject *receiver,
Sender *sender)
{