From 625c881cc74f2552e211b9ba81ac3b0ed30e9947 Mon Sep 17 00:00:00 2001 From: Milian Wolff Date: Thu, 9 Jan 2014 17:21:39 +0100 Subject: Add declarative object-registration API to QML WebChannel. The new registeredObjects list property is now preferred over the old imparative registerObject/registerObjects API. Items that are added to the list need an attached WebChannel.id property which holds the identifier under which the object is published to remote clients. Change-Id: I96a8047b9a85e27f3fd48c900180c22ebd20eb35 Reviewed-by: Simon Hausmann --- src/webchannel/qwebchannel.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/webchannel/qwebchannel.cpp') diff --git a/src/webchannel/qwebchannel.cpp b/src/webchannel/qwebchannel.cpp index f7a2c5f..70c8f35 100644 --- a/src/webchannel/qwebchannel.cpp +++ b/src/webchannel/qwebchannel.cpp @@ -123,6 +123,12 @@ void QWebChannel::registerObject(const QString &id, QObject *object) d->publisher->registerObject(id, object); } +void QWebChannel::deregisterObject(QObject *object) +{ + // handling of deregistration is analogously to handling of a destroyed signal + d->publisher->signalEmitted(object, s_destroyedSignalIndex, QVariantList() << QVariant::fromValue(object)); +} + bool QWebChannel::blockUpdates() const { return d->publisher->blockUpdates; -- cgit v1.2.1