diff options
author | Milian Wolff <milian.wolff@kdab.com> | 2014-01-09 17:21:39 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-10 13:09:03 +0100 |
commit | 625c881cc74f2552e211b9ba81ac3b0ed30e9947 (patch) | |
tree | 246cf6d749138448423bf6b4da17a0306f8c1e0a /src/webchannel/qwebchannel.cpp | |
parent | b23442674f1b30d936fca43aee7b7d6dece15b2c (diff) | |
download | qtwebchannel-625c881cc74f2552e211b9ba81ac3b0ed30e9947.tar.gz |
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 <simon.hausmann@digia.com>
Diffstat (limited to 'src/webchannel/qwebchannel.cpp')
-rw-r--r-- | src/webchannel/qwebchannel.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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; |