aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilian Wolff <milian.wolff@kdab.com>2014-07-03 15:33:53 +0200
committerMilian Wolff <milian.wolff@kdab.com>2014-07-05 00:10:58 +0200
commit125c5f7dc270ab58e5f876cf8bc8aaf56d9e8f1b (patch)
tree784be6f1280ae59f3547353e2a7a921dcc6cdb7f
parent55fbe2c7255ce62bf19e929ce9f22feda3a0577a (diff)
Make the registered objects of a QWebChannel accessible.
This is useful for integration into QtWebKit. Change-Id: I80d79c0ed8a627d62ee45090d7bceca22fdf56ce Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
-rw-r--r--src/webchannel/qwebchannel.cpp5
-rw-r--r--src/webchannel/qwebchannel.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/src/webchannel/qwebchannel.cpp b/src/webchannel/qwebchannel.cpp
index e4cf0d6..651de58 100644
--- a/src/webchannel/qwebchannel.cpp
+++ b/src/webchannel/qwebchannel.cpp
@@ -93,6 +93,11 @@ void QWebChannel::registerObjects(const QHash< QString, QObject * > &objects)
}
}
+QHash<QString, QObject *> QWebChannel::registeredObjects() const
+{
+ return d->publisher->registeredObjects;
+}
+
void QWebChannel::registerObject(const QString &id, QObject *object)
{
d->publisher->registerObject(id, object);
diff --git a/src/webchannel/qwebchannel.h b/src/webchannel/qwebchannel.h
index 5016b52..3e6f7a1 100644
--- a/src/webchannel/qwebchannel.h
+++ b/src/webchannel/qwebchannel.h
@@ -72,6 +72,7 @@ public:
* TODO: This must be called, before clients are initialized.
*/
void registerObjects(const QHash<QString, QObject*> &objects);
+ QHash<QString, QObject*> registeredObjects() const;
Q_INVOKABLE void registerObject(const QString &id, QObject *object);
Q_INVOKABLE void deregisterObject(QObject *object);