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 --- tests/qml/tst_metaobjectpublisher.qml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/qml/tst_metaobjectpublisher.qml b/tests/qml/tst_metaobjectpublisher.qml index cc679ad..e8b1c1e 100644 --- a/tests/qml/tst_metaobjectpublisher.qml +++ b/tests/qml/tst_metaobjectpublisher.qml @@ -51,11 +51,14 @@ WebChannelTest { { lastMethodArg = arg; } + + WebChannel.id: "myObj" } QtObject { id: myOtherObj property var foo: 1 property var bar: 1 + WebChannel.id: "myOtherObj" } QtObject { id: myFactory @@ -65,6 +68,7 @@ WebChannelTest { lastObj = component.createObject(myFactory, {objectName: id}); return lastObj; } + WebChannel.id: "myFactory" } Component { @@ -80,11 +84,7 @@ WebChannelTest { function initTestCase() { - webChannel.registerObjects({ - "myObj": myObj, - "myOtherObj": myOtherObj, - "myFactory": myFactory - }); + webChannel.registeredObjects = [myObj, myOtherObj, myFactory]; } function awaitInit() -- cgit v1.2.1