summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/qtobject/main.qml13
-rw-r--r--examples/standalone/main.cpp9
2 files changed, 2 insertions, 20 deletions
diff --git a/examples/qtobject/main.qml b/examples/qtobject/main.qml
index 76ef3d9..7bfe714 100644
--- a/examples/qtobject/main.qml
+++ b/examples/qtobject/main.qml
@@ -55,22 +55,11 @@ Rectangle {
objectName: "initialTestObject"
}
- MetaObjectPublisher {
- id: publisher
- webChannel: webChannel
- }
-
WebChannel {
id: webChannel
- onRawMessageReceived: {
- if (!publisher.handleRawMessage(rawMessage)) {
- console.log("unhandled request: ", rawMessage);
- }
- }
-
onInitialized: {
- publisher.registerObjects({
+ registerObjects({
"testObjectFactory": factory,
"initialTestObject": testObject
});
diff --git a/examples/standalone/main.cpp b/examples/standalone/main.cpp
index 6970633..1187950 100644
--- a/examples/standalone/main.cpp
+++ b/examples/standalone/main.cpp
@@ -41,7 +41,6 @@
****************************************************************************/
#include "qwebchannel.h"
-#include "qmetaobjectpublisher.h"
#include <QApplication>
#include <QDialog>
@@ -111,16 +110,10 @@ int main(int argc, char** argv)
QApplication app(argc, argv);
QWebChannel channel;
- QMetaObjectPublisher publisher;
- publisher.setWebChannel(&channel);
- QObject::connect(&channel, SIGNAL(rawMessageReceived(QString)),
- &publisher, SLOT(handleRawMessage(QString)));
Dialog dialog(&channel);
- QVariantMap objects;
- objects[QStringLiteral("dialog")] = QVariant::fromValue(&dialog);
- publisher.registerObjects(objects);
+ channel.registerObject(QStringLiteral("dialog"), &dialog);
return app.exec();
}