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 /tests | |
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 'tests')
-rw-r--r-- | tests/qml/tst_metaobjectpublisher.qml | 10 |
1 files changed, 5 insertions, 5 deletions
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() |