summaryrefslogtreecommitdiff
path: root/tests/qml/data/property.html
blob: 5d031185d80ddcc2b80cf8f6d258c19f57cff221 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<html>
    <head>
        <script type="text/javascript" src="qrc:///qwebchannel/qwebchannel.js"></script>
        <script type="text/javascript">
            //BEGIN SETUP
            var baseUrl = (/[?&]webChannelBaseUrl=([A-Za-z0-9\-:/\.]+)/.exec(location.search)[1]);
            new QWebChannel(baseUrl, function(channel) {
                channel.exec({label: "init", value: myObj.myProperty()});
                myObj.myPropertyChanged.connect(function() {
                    channel.exec({label: "changed", value: myObj.myProperty()});
                });
                channel.subscribe("setProperty", function(newValue) {
                    myObj.myProperty = newValue;
                });
            });
            //END SETUP
        </script>
    </head>
    <body>
    </body>
</html>