summaryrefslogtreecommitdiff
path: root/tests/qml/data/wrapper.html
blob: a5564864dced90885ee559d86e75a6797bbff28b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<html>
    <head>
        <script type="text/javascript" src="qrc:///qwebchannel/qwebchannel.js"></script>
        <script type="text/javascript" src="testsetup.js"></script>
        <script type="text/javascript">
            //BEGIN SETUP
            createWebChannel(function(channel) {
                myFactory.create("testObj", function(obj) {
                    window[obj.objectName()] = obj;
                    obj.mySignal.connect(function(arg1, arg2) {
                        channel.exec({label: "signalReceived", args: [arg1, arg2]});
                    });
                    obj.myProperty = 42;
                    obj.myMethod("foobar");
                });
                channel.subscribe("triggerDelete", function() {
                    testObj.deleteLater();
                });
                channel.subscribe("report", function() {
                    channel.exec({label:"report", obj: testObj})
                });
            });
            //END SETUP
        </script>
    </head>
    <body>
    </body>
</html>